Skip to content
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

No working as intended - Always creates Fragments upon navigation #1

Open
ajrulez opened this issue Aug 23, 2017 · 2 comments
Open

Comments

@ajrulez
Copy link

ajrulez commented Aug 23, 2017

I was testing the sample app, and I had put breakpoints in on onCreateView, onViewCreated (and all other Fragment lifecycle methods). Much to my disappointment, all Fragments were being created every time I navigated between different Fragments using BottomNav.

I thought the very point of this library is to avoid re-creating Fragments, please correct me if I am wrong. I would appreciate any help with this ([email protected])

Is it because -
Fragment fragment = mFragmentManager.findFragmentByTag(tag); always returns null in method "changeFragment()". ??

@okaybroda
Copy link
Owner

Hi @ajrulez ,

Yes, the point of the library is to avoid recreating Fragments and to keep the view states of each fragments.

From what I've tested the fragments are only recreated when the Activity is rotated. This is unavoidable from what I've tested so far. However if you have an improvement or an idea to solve this, please send a PR.

Cheers,
Viven.

@ajrulez
Copy link
Author

ajrulez commented Sep 27, 2017

Thanks for the comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants