Status Update
Comments
[Deleted User] <[Deleted User]> #2
su...@gmail.com <su...@gmail.com> #3
The problem was caused by this line of code:
dialogFragment.show(mFragmentManager, DIALOG_TAG + mDialogCount++);
and the correct version needs to be like this:
dialogFragment.show(mFragmentManager, DIALOG_TAG + ++mDialogCount);
(Basically the DialogCounter needs to be incremented before in order the popBackStack function to work properly)
As a workaround for this issue you can make a Custom DialogFragmentNavigator based on the original DialogFragmentNavigator with fixed line of code. You also need to add that CustomNavigation to NavController.
dialogFragment.show(mFragmentManager, DIALOG_TAG + mDialogCount++);
and the correct version needs to be like this:
dialogFragment.show(mFragmentManager, DIALOG_TAG + ++mDialogCount);
(Basically the DialogCounter needs to be incremented before in order the popBackStack function to work properly)
As a workaround for this issue you can make a Custom DialogFragmentNavigator based on the original DialogFragmentNavigator with fixed line of code. You also need to add that CustomNavigation to NavController.
Description
dialogFragment.show(mFragmentManager, DIALOG_TAG + mDialogCount++);
//popBackStack
Fragment existingFragment = mFragmentManager
.findFragmentByTag(DIALOG_TAG + mDialogCount--);
This way first tag is `androidx-nav-fragment:navigator:dialog:0` but mDialogCount then add one so that findFragmentByTag `androidx-nav-fragment:navigator:dialog:1` doesn't do anything