private void registerReceiver() { mTickReceiver = new LocationReceiver(); IntentFilter filter = new IntentFilter(Android.Content.Intent.ActionTimeTick); // this will broadcast Intent every minute RegisterReceiver(mTickReceiver, filter); }
public Main() { try { InitializeComponent(); this.mReceiver = new LocationReceiver(this); this.mReceiver.LocationNotify += new LocationNotifyEventHandler(OnLocationNotify); this.mReceiver.LocationServerShutdown += new LocationServerShutdownHandler(OnLocationServerShutdown); } catch (LocationServicesException e1) { MessageBox.Show(e1.Message); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
public override Void OnDestroy() { UnregisterReceiver(mTickReceiver); mTickReceiver = null; }