I created an AsyncTask to perform my background operation. The UI shows a ProgressDialog. I pass the Context to the constructor of the AsyncTask.
When I want to manipulate the the ProgressDialog text from AsyncTask it errors because the ProgressDialog box is created by a different thread.
Tips or ideas on how I can make the AsyncTask communicate with the ProgressDialog box, or a better way to create the ProgressDialog box?
You shouldn’t communicate with UI from
AsyncTask‘sdoInBackgroundfunction. UseonProgressUpdatefunction instead.