public override void OnAccessibilityEvent(AccessibilityEvent e) { Instance = this; if (e == null) { return; } if (string.IsNullOrWhiteSpace(e.PackageName)) { return; } if (string.IsNullOrWhiteSpace(e.ClassName)) { return; } if (AutoGlobal.Instance?.Events == null) { return; } foreach (var item in AutoGlobal.Instance?.Events) { item.Event(this, e); } }
protected override void OnServiceConnected() { Instance = this; base.OnServiceConnected(); var autoGlobal = AutoGlobal.Instance; if (autoGlobal?.Context != null) { Toast.MakeText(autoGlobal.Context, "服务启动成功", ToastLength.Long).Show(); } //执行启动主界面的事件 MessageBus.Default.Post("StartActivityMessage", this, "MainActivity"); }
public override void OnDestroy() { Instance = null; base.OnDestroy(); }