Example #1
0
        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);
            }
        }
Example #2
0
        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");
        }
Example #3
0
 public override void OnDestroy()
 {
     Instance = null;
     base.OnDestroy();
 }