0

Thread.sleep(10000) waits for 10 sec before execution of the program.
I want the code that waits the next task for 10 sec when the first task is running.

How do I execute the code with delay without clearing the screen?

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115

1 Answers1

0
final Handler handler = new Handler();
handler.postDelayed(new Runnable() {
  @Override
  public void run() {
    //Do something after 100ms
  }
}, 100);

Original: https://stackoverflow.com/a/9166354/4064490