Can somebody please explain how android.app.ProgressDialog is properly used. Since, when I call hide() method, it says Only the thread which created the ui can touch it. But dismiss() method removed the progress dialog. But after dismiss() method, calling show() does not properly show the progress dialog.
Can somebody please explain how android.app.ProgressDialog is properly used. Since, when I call hide()
Share
Do not use
hide()ordismiss()outside UI thread. You must invoke these methods in UI thread.To hide dialog from non UI thread you can use
View.postif you have any view orActivity.runInUiThread.More better use
onPostExecuteoronCancelforAsyncTaskclass. OrHandleras a general approach.