I have a progress dialog in my AsyncTask extended class. I have set the layout to the progress dialog using setcontentview(). I want to change the design of the progress dialog and show for 2 seconds when it is complete (i.e. in PostExecute()).
I start Progress dialog in onPreexecute() and dismiss it in onPostexecute() methods.
This is how I initialised progress dialog in onPreexecute
progressDialog = ProgressDialog.show(context, null, null);
progressDialog.setContentView(R.layout.progress_meditate);
progressDialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
progressDialog.setProgressDrawable(new ColorDrawable(Color.WHITE));
I tried below code in onPostExecute
progressDialog.setContentView(R.layout.progress_complete);
sleep(2000);
progressDialog.dismiss();
but it is not working. My progress_complete layout is not getting shown. Progress dialog gets dismissed after sleep time with same design.