Reputation: 41
I have seen usage of Fragment's constructor to pass data between the fragments(ex. new MyFragment(myData)) but I want to know if we should use that approach or not, the official google developer documentation mentions the usage of Bundle. I want to know what is the better approach and why? I am a beginner in android development so please feel free to guide. Thanks in advance!
Upvotes: 1
Views: 143
Reputation: 76589
Pass Bundle
as arguments, extract them onCreate()
...
then you can use them with the Navigation library, too.
Upvotes: 1