The problem may also be that you did not set the "start message". If you do not set the message for your ProgressDialog before trying to do this inside onProgressUpdate , this will not work.
ProgressDialog progressDialog = new ProgressDialog(this); progressDialog.setTitle("Title"); progressDialog.setMessage("Initial message needed"); public class foo extends AsyncTask<Void,Integer,Void> { ... }
Also note that if you need to update the execution as well as the message, you can use the Integer argument with one of the integers that determines the amount of execution, and another that defines the message as the index of the String[] array of messages (if the messages are known in advance) .
source share