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

前端 未结 2 702
我寻月下人不归
我寻月下人不归 2021-02-15 16:23

I have this Android activity/layout with a button. When I click this button, it opens a DialogFragment with 2 spinners. When the DialogFragment shows up, I need to populate thes

相关标签:
2条回答
  • 2021-02-15 16:55

    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.

    0 讨论(0)
  • 2021-02-15 17:11

    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);
        }
    }
    
    0 讨论(0)
提交回复
热议问题