Skip to content

Instantly share code, notes, and snippets.

@filipesperandio
Created May 13, 2016 20:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save filipesperandio/fa25b38df3dd01bcf1a029305c2a8cbc to your computer and use it in GitHub Desktop.
Save filipesperandio/fa25b38df3dd01bcf1a029305c2a8cbc to your computer and use it in GitHub Desktop.
private void shceduleSomething() {
final Handler handler = new Handler();
Timer timer = new Timer();
TimerTask doAsynchronousTask = new TimerTask() {
@Override
public void run() {
handler.post(new Runnable() {
public void run() {
doSomething();
}
});
}
};
timer.schedule(doAsynchronousTask, 3000);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment