I have a DialogFragment that own 2 inner Fragments (which are displayed as tabs in a ViewPager).
The DialogFragment is called as usual, using a newInstance() pattern, with a Bundle containing a simple int (an id, for database fetching). It then calls its 2 Fragments, which will need the int.
I have 2 options here :
- having a
static intfield of myDialogFragment, which would be instanciated inonCreateView()when IgetArguments(), and read inside my inner Fragments - using another
newInstance()pattern inside my inner fragments and passing the int along
What's the difference between these 2 ways ?