public override void OnCreate() { base.OnCreate(); timer = new CountDownTimer(0, 0); timer.TimeChanged += Timer_TimeChanged; timer.CountDownFinished += Timer_CountDownFinished; timerBroadcastIntent = new Intent("com.kudchikarsk.remindme.timer"); }
private void Timer_CountDownFinished() { timerBroadcastIntent.PutExtra("status", 2); SendBroadcast(timerBroadcastIntent); timer.TimeChanged -= Timer_TimeChanged; timer.CountDownFinished -= Timer_CountDownFinished; timer.Dispose(); timer = null; StopSelf(); }
public override void OnDestroy() { base.OnDestroy(); if (timer != null) { timer.TimeChanged -= Timer_TimeChanged; timer.CountDownFinished -= Timer_CountDownFinished; timer.Dispose(); } timer = null; }