New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Question] - How to use fragment manager? #30
Comments
Hi, from what I understand you want to have a callback every time your back stack changes. In that case, you don't need to check if navigator is initialized. Just place attach the listener during
This will allow you to listen to any changes carried out via Also from your code check if |
Try calling navigate.navigate to a different fragment and see if it gets called? |
@KaustubhPatange i did but still same result |
This is not a navigator issue but the way how fragments works. If you are not doing it then the listener won't be called. |
@KaustubhPatange thanks for your support. Let me check |
if (this::navigate.isInitialized) { childFragmentManager.addOnBackStackChangedListener { Timber.e("addOnBackStackChangedListener") val fragment = navigate.getCurrentFragment() ?: return@addOnBackStackChangedListener if (fragment is BaseFragment<*>) { fragment.onFragmentResume() } } }
Im using navigator(inside fragment) to manage my fragments but when I use above code to addOnBackStackChangedListener nothing happen.
I also tried navigate.getFragmentManager() but does not work
The text was updated successfully, but these errors were encountered: