Beispiel #1
0
 static void StopListeners()
 {
     Platform.CurrentContext.UnregisterReceiver(conectivityReceiver);
     conectivityReceiver?.Dispose();
     conectivityReceiver = null;
 }
Beispiel #2
0
 static void StartListeners()
 {
     ValidatePermission();
     conectivityReceiver = new ConnectivityBroadcastReceiver(OnConnectivityChanged);
     Platform.CurrentContext.RegisterReceiver(conectivityReceiver, new IntentFilter(ConnectivityManager.ConnectivityAction));
 }