I used suggestion in this but I have same problem yet. Thanks my friend for suggestion for using AsyncTask but it is not worked for me. What? This is my 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 anyone help me?