Progressdialog Doesn't Appear Immediately
I have a fragment with some buttons in it, when a button is clicked it should show a ProgressDialog, load an array of bitmaps and show it in the fragment in a gallery, dismiss Prog
Solution 1:
You are loading the images on the main UI thread - you should do this in a background process as it may cause your UI to become unresponsive (and cause your ProgressDialog
to show up at the wrong time).
You should look into using an AsyncTask to carry out loading of the images in the background.
Display the ProgressDialog
in AsyncTask.onPreExecute
, load images in AsyncTask.doInBackground
and dismiss the dialog in AsyncTask.onPostExecute
.
Post a Comment for "Progressdialog Doesn't Appear Immediately"