Ejemplo n.º 1
0
 private void UnRegisterBroadcastReceiver()
 {
     if (_trackingBroadcastReceiver != null)
     {
         LocalBroadcastManager.UnregisterReceiver(_trackingBroadcastReceiver);
         _trackingBroadcastReceiver = null;
     }
 }
Ejemplo n.º 2
0
        private void RegisterBroadcastReceiver()
        {
            if (_trackingBroadcastReceiver == null)
            {
                var intentFilter = new IntentFilter();
                intentFilter.AddAction("LocationChanged");

                _trackingBroadcastReceiver = new TrackingBroadcastReceiver(LocationChanged);

                LocalBroadcastManager.RegisterReceiver(_trackingBroadcastReceiver, intentFilter);
            }
        }