Skip to content

Instantly share code, notes, and snippets.

@scott2449
Created February 21, 2011 17:37
Show Gist options
  • Save scott2449/837394 to your computer and use it in GitHub Desktop.
Save scott2449/837394 to your computer and use it in GitHub Desktop.
executor service
public void onStart(Intent intent, int startId) {
super.onStart(intent, startId);
timer = Executors.newScheduledThreadPool(2);
timer.scheduleAtFixedRate(new Runnable() {
public void run() {
}
}, 0, 300, TimeUnit.SECONDS);
}
public void onDestroy(Intent intent, int startId) {
timer.shutdown();
super.onDestroy();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment