@Override public void onResume() { super.onResume(); if (timer != null) { timer.schedule(timerTask = new MyTimeTask(), 3000, 3000); } }
@Override public void onPause() { super.onPause(); if (timerTask != null) timerTask.cancel(); }