Dailogfragment - Getarguments/setarguments - Why Passing Arguments In A Bundle?
In the official example http://developer.android.com/reference/android/app/DialogFragment.html#BasicDialog the fragment is being created with use of static factory method that wrap
Solution 1:
Enforcing a no-arguments, default constructor pattern allows the system to re-create the fragment dynamically when necessary. From the docs:
All subclasses of Fragment must include a public empty constructor. The framework will often re-instantiate a fragment class when needed, in particular during state restore, and needs to be able to find this constructor to instantiate it. If the empty constructor is not available, a runtime exception will occur in some cases during state restore.
"will often" and "in some cases" leaves it vague. But short of satisfying your curiosity ... arguments it is!
Post a Comment for "Dailogfragment - Getarguments/setarguments - Why Passing Arguments In A Bundle?"