Attempting to learn about fragments, and studying the docs and some samples, I am not really clear as to what the <fragment> tag represents in an XML file and how it relates to the fragment "container view" that is supposed to be passed to onCreateView. Mainly, in the sample that I'm using, which defines the fragment in the XML file using the syntax "<fragment android:name="..." android:id="...">, when onCreateView in the fragment is called, the 2nd argument (supposed to be the containing ViewGroup) is always null. What's up with that? Shouldn't it be the LinearLayout or whatever contains this fragment in the XML code?

In fact, the entire declaration of <fragment> confuses me, since I don't think that it is really a view by itself, so why does it have width and height dimensions? After all, if you dynamically add a fragment to a ViewGroup, it's the view returned by onCreateView that gets displayed, so why these dimensions?

Same thing with the fragment ID; is this the ID of the view created by the fragment, or of its container, or something else?

I must be missing a concept here, but maybe I just have to start working on my own code conversion to fragments and see what happens...

  Doug Gordon
  GHCS Software

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to