Showing two ProgressDialog instead one

别等时光非礼了梦想. 提交于 2019-12-11 07:32:51

问题


When I use samsung galaxy mini 4.4 I see two progressDialog(picture below). When I use another device - everething is okay

if (progressDialog == null) {
        progressDialog = new ProgressDialog(getActivity(), R.style.AlertDialogThemeBlackColor);
        progressDialog.setMessage(getResources().getString(R.string.loading_your_data));
        progressDialog.setCancelable(false);
    }
    progressDialog.show();

回答1:


I didn't found reason, but I found a way to avoid this. Need to create a dialog in the following manner:

new ProgressDialog(new ContextThemeWrapper(getActivity(), R.style.ProgressDialog));

R.style.ProgressDialog - your theme




回答2:


I changed ProgressDialog's style from my custom style to Theme_AppCompat_Dialog

new ProgressDialog(mContext, R.style.Theme_AppCompat_Dialog)

This solved the issue, but couldn't find out the reason for the problem.



来源:https://stackoverflow.com/questions/36755731/showing-two-progressdialog-instead-one

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!