My CountDownTimer continue to count even the user press Return key. I put
public void onUserLeaveHint(){
myTimer.cancel();
}
and it correctly does myTimer.cancel() timer only when the user press Home key. How can I cancel the timer when the activity where it counts is gone?
if you want to capture Back key event in Android you will use
onBackPressed()like this: