I'm switched to NavigationComponent and i don't know how close fragments manually using this component, in activities we have finish() method that close an activity, i need to do similar thing like this in NavigationComponent.
I'm switched to NavigationComponent and i don't know how close fragments manually using this component, in activities we have finish() method that close an activity, i need to do similar thing like this in NavigationComponent.
you can use below line in Fragment class:
getActivity().getParentFragmentManager().popBackStack();
or if you are in an activity then you can use
getParentFragmentManager().popBackStack();
If you're using the Navigation component, you can also simply call Navigator.popBackStack() where Navigator is your Navigator object.
Here's the documentation for the NavController