How can I open a ProgressDialog on top of a DialogFragment?

ⅰ亾dé卋堺 提交于 2019-12-03 13:06:27

Apparently thats a widely complained about subject with ProgressDialog, I suggest you try a normal dialog, created with the builder and whose layout (a custom one made by you) includes the progress bar or loading or whatever you need. This should solve your problem.

I also had a problem when my parent DialogFragment was recreated due to configuration change. I couldn't make the progressDialog to be visible on top again. The solution was to show progressDialog in the onResume() event:

@Override
public void onResume() {
    super.onResume();
    if (inProgress) {
        progressDialog = ProgressDialog.show(ctx, "Report request", "connecting...", true);
    }
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!