Пример #1
0
 public void StopEnergySaverListeners()
 {
     try
     {
         Platform.AppContext.UnregisterReceiver(powerReceiver);
     }
     catch (Java.Lang.IllegalArgumentException)
     {
         System.Diagnostics.Debug.WriteLine("Energy saver receiver already unregistered. Disposing of it.");
     }
     powerReceiver.Dispose();
     powerReceiver = null;
 }
Пример #2
0
        static void StopEnergySaverListeners()
        {
            if (!Platform.HasApiLevel(BuildVersionCodes.Lollipop))
            {
                return;
            }

            try
            {
                Platform.AppContext.UnregisterReceiver(powerReceiver);
            }
            catch (Java.Lang.IllegalArgumentException)
            {
                System.Diagnostics.Debug.WriteLine("Energy saver receiver already unregistered. Disposing of it.");
            }
            powerReceiver.Dispose();
            powerReceiver = null;
        }