示例#1
0
        public override StartCommandResult OnStartCommand(Intent intent, StartCommandFlags flags, int startId)
        {
            instance = this;

            AppInstanceManager theInstance = AppInstanceManager.Instance;

            appSetting = theInstance.getAppSetting();

            if (!theInstance.isConnected)
            {
                if (appSetting != null)
                {
                    new System.Threading.Thread(new System.Threading.ThreadStart(() =>
                    {
                        theInstance.setupConnection(appSetting.getIPAddress(), int.Parse(appSetting.getTcpPort()));
                    })).Start();
                }
            }

            setupService(false);
            return(StartCommandResult.NotSticky);
        }
示例#2
0
 public override void OnDestroy()
 {
     base.OnDestroy();
     instance = null;
 }
示例#3
0
 public override void OnCreate()
 {
     base.OnCreate();
     instance             = this;
     mNotificationManager = (NotificationManager)GetSystemService(NotificationService);
 }