public override StartCommandResult OnStartCommand(Intent intent, Android.App.StartCommandFlags flags, int startId) { var callback = (Messenger)intent.GetParcelableExtra("messenger"); var m = Message.Obtain(); m.What = MainActivity.MessageServiceObj; m.Obj = this; try { callback.Send(m); } catch (RemoteException e) { Log.Error(Tag, e, "Error passing service object back to activity."); } return(StartCommandResult.NotSticky); }
public override StartCommandResult OnStartCommand(Intent intent, Android.App.StartCommandFlags flags, int startId) { var callback = (Messenger)intent.GetParcelableExtra("messenger"); var m = Message.Obtain(); m.What = MainActivity.MESSAGE_SERVICE_CLEAR_PAYMENTS; m.Obj = this; try { callback.Send(m); } catch (RemoteException e) { Debug.WriteLine(e); } return(StartCommandResult.NotSticky); }
public override StartCommandResult OnStartCommand(Intent intent, Android.App.StartCommandFlags flags, int startId) { var callback = (Messenger)intent.GetParcelableExtra("messenger"); var m = Message.Obtain(); m.Obj = this; try { callback.Send(m); } catch (RemoteException e) { Log.Error(Tag, e, "Error passing service object back to activity."); } Toast.MakeText(this, "OnStartCommand", ToastLength.Short).Show(); return(StartCommandResult.Sticky); }
public override Android.App.StartCommandResult OnStartCommand(Android.Content.Intent intent, Android.App.StartCommandFlags flags, int startId) { if (intent != null) { string action = intent.Action; if (Constants.ActionDismiss.Equals(action)) { // We need to dismiss the wearable notification. We delete the DataItem that created the notification to inform the wearable. int notificationId = intent.GetIntExtra(Constants.KeyNotificationId, -1); if (notificationId == Constants.BothId) { DismissWearableNotification(notificationId); } } } return(base.OnStartCommand(intent, flags, startId)); }
public override StartCommandResult OnStartCommand(Intent intent, Android.App.StartCommandFlags flags, int startId) { return(StartCommandResult.Sticky); }