コード例 #1
0
        void Handle_InitClick(object sender, System.EventArgs e)
        {
            AndroidMvxInitializer.SafeEnsureInitialized();
            var intent = new Intent(Consts.InitIntentFilter);

            SendBroadcast(intent);
        }
コード例 #2
0
        //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());
        }
コード例 #3
0
 public override void OnReceive(Context context, Intent intent)
 {
     AndroidMvxInitializer.SafeEnsureInitialized();
     context.StartService(new Intent(context, typeof(TestTimerService)));
 }
コード例 #4
0
 public override void OnReceive(Context context, Intent intent)
 {
     AndroidMvxInitializer.SafeEnsureInitialized();
 }