コード例 #1
0
 static void StopBatteryListeners()
 {
     try
     {
         Platform.AppContext.UnregisterReceiver(batteryReceiver);
     }
     catch (Java.Lang.IllegalArgumentException)
     {
         System.Diagnostics.Debug.WriteLine("Battery receiver already unregistered. Disposing of it.");
     }
     batteryReceiver.Dispose();
     batteryReceiver = null;
 }
コード例 #2
0
 static void StopBatteryListeners()
 {
     Platform.CurrentContext.UnregisterReceiver(batteryReceiver);
     batteryReceiver?.Dispose();
     batteryReceiver = null;
 }