Results 1 to 2 of 2
Thread: AsyncTask and ProgressDialog
- 04-05-2012, 02:00 AM #1
Member
- Join Date
- Feb 2012
- Location
- Queensland, Australia
- Posts
- 12
- Rep Power
- 0
AsyncTask and ProgressDialog
Hi All,
I am using an asynctask class to compute data in the background while showing a progressdialog.
On completion of the background task the data is displayed on the screen
Everything works as expected except the progressdialog is running in the background behind the dialog as show in the diagram below.
Has anyone had this happen to them and how did you fix it.

The for the AsyncTask is as follows
Thanks in AdvanceJava Code:private class MyProgressBarDialog extends AsyncTask<Void, Void, Void> { protected void onPreExecute() { super.onPreExecute(); mProgressDialog = new ProgressDialog(getContext()); mProgressDialog.setIndeterminate(true); mProgressDialog.setMessage("Please wait while loading"); mProgressDialog.setCancelable(false); mProgressDialog.show(); } protected Void doInBackground(Void... params) { try { buildGrid(); } catch (Exception e) { e.printStackTrace(); } return null; } protected void onPostExecute(Void unused) { super.onPostExecute(unused); if (mProgressDialog.isShowing()) { mProgressDialog.dismiss(); } renderGrid(); } }
- 04-10-2012, 03:22 AM #2
Member
- Join Date
- Feb 2012
- Location
- Queensland, Australia
- Posts
- 12
- Rep Power
- 0


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks