android - Display Progress bar while delay? -


in app want have delay of 5 seconds , in 5 seconds user should see progress dialog tried

    progressdialog.show();   try {             thread.sleep(5000);         } catch (interruptedexception e) {             e.printstacktrace();         }      progressdialog.dismiss(); 

but while thread sleeping progessdialog wont show .

 new countdowntimer(6000, 1000) {             public void onfinish() {                mprogressdialog.dismiss();               // whole code             }              public void ontick(long millisuntilfinished) {                 mprogressdialog.show();             }         }.start(); 

this works fine


Comments

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

android - CoordinatorLayout, FAB and container layout conflict -