Skip to content

Instantly share code, notes, and snippets.

@kenota
Created July 14, 2012 14:33
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 kenota/3111617 to your computer and use it in GitHub Desktop.
Save kenota/3111617 to your computer and use it in GitHub Desktop.
starting scheduled task
final Handler handler = new Handler(hThread.getLooper());
final long oneMinuteMs = 60 * 1000;
Runnable eachMinute = new Runnable() {
@Override
public void run() {
Log.d(TAG, "Each minute task executing");
handler.postDelayed(this, oneMinuteMs);
}
};
// Schedule the first execution
handler.postDelayed(eachMinute, oneMinuteMs);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment