-3

I want to pause my program for 10 sec. I don't want sleep code. After pausing for 10 sec I want to run my further code.

2 Answers2

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

blatantly copied and pasted from here How to call a method after a delay in Android

em_
  • 2,134
  • 2
  • 24
  • 39
0
         new Handler().postDelayed(new Runnable(){
                public void run(){
                 //your code will execute after 10 secs

                }},10000);
Midhun
  • 178
  • 1
  • 10