我正在使用 BottomSheetDialogFragment 显示一些自定义设置。
需求:
当我点击 BottomSheetDialogFragment 中的任何选项卡时,我将替换该片段并将其添加到回退堆栈中,以便在用户单击“返回”或“上一步”操作时,它应返回到 BottomSheetDialogFragment 的最后一个设置片段。
我想使用 Navigation Architecture Component 简化我的事务。
问题: 如果我使用 Navigation Architecture Component 从 FragmentA 导航到 BottomSheetDialogFragment,则会收到以下错误:
java.lang.IllegalStateException: dialog must not be null BottomSheetDialogFragment
我不知道如何使用 Navigation Architecture Component 实例化 BottomSheetDialogFragment,并且使用下面的代码将无法使用 Navigation Architecture Component 维护回退堆栈。
BottomSheetDialogFragment.show(FragmentManager manager, String tag)