as a general way of working with fragments, as JafarKhQ noted, you should not pass parameters in the constructor, but with the Bundle .
The built-in method for the Fragment class is setArguments(Bundle) and getArguments() .
basically, what you do is set up a package with all your Parcelable and send them.
in turn, your fragment will receive those elements in it onCreate and do this magic for them.
the method shown on the DialogFragment link was one way to do this in a multi-user fragment with one specific data type and works fine fine, but you can also do it manually.
thepoosh Mar 17 '13 at 9:45 2013-03-17 09:45
source share