ProgressDialog in AsyncTask: Dynamic Update Text/Title

Sometimes, you may want to update the text shown in the progress dialog. If you try to perform this in doInBackground() you’ll get an exception along the lines: Only the original thread that created a view hierarchy can touch its views The solution is to not do it in doInBackground() but instead trigger onProgressUpdate() and […]

ProgressDialog in AsyncTask: Dynamic Update max()

Sometimes you determine the max of the progress bar in the background task. Unfortunately, there’s almost no way to transmit that to an UI thread-executed method like onProgressUpdate() (well, you could, but that’d be abusing the method). Instead you can do something like:

This way, the variables are updated in their own thread and […]

Scroll to top