0

I have AsynTask and show progress dialoge while it is running. Phone receive incoming call. After call stopped the progress dialoge is not showing but the activity layout is dim in such way if the dialoge is showing. Has you any ideas?

I have somethin like this:

Recovery recovery=new Recovery();
recovery.execute();

And asynktask:

public class Recovery extends AsyncTask<String, Void, Integer>{
         @Override
         protected Integer doInBackground(String... uri) {
             publishProgress();
             //some code
             return Ret;
         }
         @Override
         protected void onProgressUpdate(Void... values) {
             super.onProgressUpdate(values);
             showDialog(RECOVERY);
         }
         @Override
         protected void onPostExecute(Integer result) {
             super.onPostExecute(result);
             dismissDialog(RECOVERY);
         }
    }

1 Answers1

0

use this way it works

  ProgressDialog dialog = new ProgressDialog(YourActivity.this);

  @Override
     protected void onPreExecute()
     {
        this.dialog.setMessage("Loading Please Wait...");
        this.dialog.show()
    }



     @Override
     protected void onPostExecute(Integer result) {
         super.onPostExecute(result);
         if (this.dialog.isShowing()) {
               this.dialog.dismiss(); 
             }
     }
Khan
  • 7,585
  • 3
  • 27
  • 44