I have an AsyncTask with an indeterminate ProgressBar that typically executes very quickly, but occasionally slowly. It’s undesirable and distracting to for the the progress bar to flash quickly when there is no discernible wait.
Is there a way to delay display of the progress bar without creating another nested AsyncTask?
Thanks to Code Droid, I was able to write an abstract
AsyncTaskclass that shows an indeterminate progress bar after a specified delay. Just extend this class instead ofAsyncTaskand be sure to callsuper()when appropriate: