Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ProgressDialog does not showing Title and Message

Hope all are playing well with Errors.

I am stuck with silly problem. I don't know why it is happening?

I have created one AsyncTask in that i am doing process of uploading images.

   /**
     * Uploading Images
     */
    private class UploadPhotosTask extends AsyncTask<Void, Integer, Integer> {

        String errorMessage;
        ArrayList<PhotoCaption> captionArrayList;
        private ProgressDialog progressDialog;

        private UploadPhotosTask(ArrayList<PhotoCaption> arrayList) {
            captionArrayList = arrayList;
        }

        @Override
        protected void onPreExecute() {
            super.onPreExecute();

            progressDialog = new ProgressDialog(AlbumPhotoDetailsActivity.this);
            progressDialog.setTitle("Wait for a while");
            progressDialog.setMessage("Uploading Photos...");
            progressDialog.setIndeterminate(true);
            progressDialog.setProgress(0);
            progressDialog.setMax(captionArrayList.size());
            progressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
            progressDialog.setCancelable(false);
            progressDialog.show();
        }

        @Override
        protected void onProgressUpdate(Integer... values) {
            super.onProgressUpdate(values);
            progressDialog.setProgress(values[0]);
        }

        @Override
        protected Integer doInBackground(Void... params) {

             //Processing for upload
        }

        @Override
        protected void onPostExecute(Integer result) {
            super.onPostExecute(result);
            progressDialog.dismiss();
        }
    }

It doesn't showing Title or Message, I dont know why.

Note: I have tried all the possibilities. If i remove setProgressStyle(ProgressDialog.STYLE_HORIZONTAL) it is displaying circular progress but i want here Horizontal ProgressBar with Number of Images which are ready to upload.

enter image description here

Any Idea? Why It is so? Your help would be appreciated. Thank you.

like image 447
Pratik Butani Avatar asked Dec 25 '22 09:12

Pratik Butani


1 Answers

It is theme issue on your end,probably textcolor set to white in your theme change these

<item name="android:textColorPrimary">@color/white</item>
<item name="android:textColorSecondary">@color/white</item>

change it to black

like image 150
JAAD Avatar answered Jan 07 '23 21:01

JAAD