gpt4 book ai didi

android - ProgressDialog 不显示标题和消息

转载 作者:太空宇宙 更新时间:2023-11-03 11:55:40 25 4
gpt4 key购买 nike

希望所有人都能很好地应对 Errors。

我被愚蠢的问题困住了。我不知道为什么会这样?

我创建了一个 AsyncTask 用于上传图片。

   /**
* 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();
}
}

它不显示标题消息,我不知道为什么。

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

有什么想法吗?为什么会这样?您的帮助将不胜感激。谢谢。

最佳答案

这是你这边的主题问题,可能 textcolor 在你的主题中设置为白色更改这些

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

把它改成黑色

关于android - ProgressDialog 不显示标题和消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35238123/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com