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

前端 未结 2 701
我寻月下人不归
我寻月下人不归 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 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);
        }
    }
    

提交回复
热议问题