Created
October 17, 2016 07:44
-
-
Save Manikkumar1988/bd9f058084d56885d1bdae3bdd309649 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
if(timer != null) { | |
timer.cancel(); | |
} | |
timer = new Timer(); | |
MyTimerTask myTimerTask = new MyTimerTask(); | |
timer.schedule(myTimerTask, 1000, 5000); | |
} | |
class MyTimerTask extends TimerTask { | |
@Override | |
public void run() { | |
runOnUiThread(new Runnable(){ | |
@Override | |
public void run() { | |
//Repeating UI task | |
} | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment