void Handle_InitClick(object sender, System.EventArgs e) { AndroidMvxInitializer.SafeEnsureInitialized(); var intent = new Intent(Consts.InitIntentFilter); SendBroadcast(intent); }
//replace void to async Task and you will see a magic private void TestStuff() { Console.WriteLine($"Thread: {System.Threading.Thread.CurrentThread.ManagedThreadId}"); AndroidMvxInitializer.SafeEnsureInitialized(); Notification.Builder notificationBuilder = new Notification.Builder(this) .SetSmallIcon(Resource.Mipmap.Icon) .SetContentTitle($"Background Tick {System.Threading.Thread.CurrentThread.ManagedThreadId}") .SetContentText(DateTime.Now.ToString()); var notificationManager = (NotificationManager)GetSystemService(NotificationService); notificationManager.Notify(9000, notificationBuilder.Build()); }
public override void OnReceive(Context context, Intent intent) { AndroidMvxInitializer.SafeEnsureInitialized(); context.StartService(new Intent(context, typeof(TestTimerService))); }
public override void OnReceive(Context context, Intent intent) { AndroidMvxInitializer.SafeEnsureInitialized(); }