cancel timer in onResume()?
===

is it possible to cancel a countdown timer in onResume() method ??????
Please reply ..
For example: when the back button is pressed the onResume() method is called ..i want to cancel the timer when it is in the login activity ..in case of any other activity i want the timer to continue running ..
i thot of witing a if condition in the onResume() activity and cancelling the timer bt tiemr does nto stop..
my approach can be wrong pls guide me
   
 void onResume()
    {
     
if(currentActivity.equals("LoginActivity")

timer.cancel;
}

}