ProgressDialog does not showing Title and Message
Asked Answered
P

2

5

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.

Polivy answered 6/2, 2016 at 6:29 Comment(3)
remove progressDialog.setIndeterminate(true); and trySignorelli
i can see it , that means it is theme issue on your end,probably textcolor set to whiteSignorelli
@ankitagrawal You are awesome at all :) Thank you so much for saving my time. :) :) I have defined <item name="android:textColorPrimary">@color/colorPrimaryText</item> which is white. So sorry for disturbing you all.Polivy
S
10

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

Signorelli answered 6/2, 2016 at 6:58 Comment(0)
P
0

Its all about theme problem as i have defined in my style.xml

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

where colorPrimaryText have white color. I have just removed that lines.

Polivy answered 6/2, 2016 at 7:1 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.