How to cancel the timer and renew the same timer?
I am creating an app that vibrate and beep every 30 sec and when I log out the vibrate and beep must be cancelled and when I log in the vibrate and beep should resume. NOTE: it must vibrate and beep for every 30 sec until I log out In my app I am using TimerTask for this implementation this is the code for vibrate and beep using TimerTask static TimerTask Task; final static Handler handler = new Handler(); static Timer t = new Timer(); public static void vib() { Task = new TimerTask() { public void run() { handler.post(new Runnable() { public void run() { Vibrator vibrator = (Vibrator)