Beispiel #1
0
 private void UnRegisterBroadcastReceiver()
 {
     if (_broadcastReceiver != null)
     {
         LocalBroadcastManager.UnregisterReceiver(_broadcastReceiver);
         _broadcastReceiver = null;
     }
 }
Beispiel #2
0
        private void RegisterBroadcastReceiver()
        {
            if (_broadcastReceiver == null)
            {
                var intentFilter = new IntentFilter();
                intentFilter.AddAction("TrackingStopped");

                _broadcastReceiver = new TracksBroadcastReceiver(TrackingStopped);

                LocalBroadcastManager.RegisterReceiver(_broadcastReceiver, intentFilter);
            }
        }