android - AsyncTask not show progress dialog immediate -


i used suggestion in this have same problem yet. friend suggestion using asynctask not worked me. what? code :

dbasynctask dba = new dbasynctask(this, xmlcommand);     dba.inprocess = true;     dba.execute("");     while (dba.inprocess) {         try {             thread.sleep(200);             println("wwwwait");         } catch (interruptedexception e) {             // todo auto-generated catch block             e.printstacktrace();         }      }      public class dbasynctask extends asynctask<string, void, string> {     public boolean inprocess;      public dbasynctask(exircommandrunner commandrunner,xmlnode xmlcommand) {         this.commandrunner = commandrunner;         this.xmlcommand = xmlcommand;      }      @override     protected void onpostexecute(string result) {         exirdebugger.println("onpostexecute");     }      @override     protected void onpreexecute() {         showprogress();     }      @override     protected string doinbackground(string... params) {     ///my process here          closeprogress();         return null;     } 

can me?

thread.sleep() blocks ui thread , therefore progress dialog cannot run. remove , inprocess polling mechanism. also, there's lot of references on using async task progress dialog.


Comments

Popular posts from this blog

c++ - Creating new partition disk winapi -

Android Prevent Bluetooth Pairing Dialog -

VBA function to include CDATA -