Skip to content

Instantly share code, notes, and snippets.

@ayushhgoyal
Created May 10, 2013 06:22
Show Gist options
  • Save ayushhgoyal/5552710 to your computer and use it in GitHub Desktop.
Save ayushhgoyal/5552710 to your computer and use it in GitHub Desktop.
This snippet can be used to delay the execution of code by certain time.
Handler handler = new Handler();
handler.postDelayed(new Runnable() {
public void run() {
//your code here- to be executed after delay
}
}, 2000); //2000 is 2 seconds here
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment