Show DialogFragment from another DialogFragment

前端 未结 9 750
春和景丽
春和景丽 2021-02-05 10:33

I have a DialogFragment that displays a list of options to the user, one of these options is \"Delete\" option, when the user presses the delete option I want to sh

9条回答
  •  渐次进展
    2021-02-05 11:06

    I came across the same problem of not being able to show another DialogFragment from within the positive and negative click listeners of the first DialogFragment. My solution was to immediately pop the first fragment, which allows the second DialogFragment to attach and display successfully.

    // Call this before adding the second dialog fragment activity.getSupportFragmentManager().popBackStackImmediate();

提交回复
热议问题