Open olexth opened 4 years ago
call your fragment.newInstance method may be? passing data to be shown for each scenario throught bundle
@esQmo thanks for your reply! Can you add details on how to modify navigation file I posted above to create an instance of a Fragment instead of pointing the same one all the time?
So, I found the "classic" way to implement the same pattern in code without the limitation of having one instance for every Fragment. For everyone interested in implementing fully functional iOS UITabBar in Android, a working version is here: https://github.com/Codeveyor/Android-Tab-Bar
Hello!
I'm using NavigationAdvancedSample structure as a base for my application. Currently, I have 5 tabs with corresponding nav stacks and in each of them I have one of app fragments, let's say UserProfileFragment, which is used in different places in all nav stacks in every of 5 tabs and which I want to reuse. Example of one of nav stack files:
What I see now is that if I populate
UserProfileFragment
with data in one place of the app, it changes UserProfileFragment appearances in all other places of tab nav stacks and behaves like a Singleton, so all its appearances have reference semantics. What I want is to reuse the same fragment for different purposes across the app but to have different instances for each use case, which will also allow me to use those instances in recursive navigation. Example navigation:Thanks in advance!