You use arguments when you are creating it in code, and XML attributes when you are creating from XML. If you want to modify the fragment state after it is made... well just add methods to your fragment to set the state.
On Wed, Apr 27, 2011 at 1:46 PM, Dave Johnston <[email protected]> wrote: > What is the correct way to pass arguments to a Fragment after > inflation (for example, after calling setContentView)? Attempting to > call setArguments() after setContentView() results in > "java.lang.IllegalStateException: Fragment already active". > > Is it simply preferable to instantiate and add Fragments via code, > rather than use fragment inflation from an XML layout? > > -dave > > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en > -- Dianne Hackborn Android framework engineer [email protected] Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

