Skip to content

Instantly share code, notes, and snippets.

@gvsharma
Created May 26, 2014 11:18
Show Gist options
  • Save gvsharma/f60f89970f07708bb580 to your computer and use it in GitHub Desktop.
Save gvsharma/f60f89970f07708bb580 to your computer and use it in GitHub Desktop.
code snippet to do a task repeatedly using timer in android
timer = new Timer();
timer.schedule(new TimerTask() {
@Override
public void run() {
getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
fetchallMessages(match_id,true);
}
});
}
}, 0, 30 * 1000);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment