Hi Dianne,
  I'd be happy to send the source, if you like.

  The key difference is that I set up the fragment in R.layout.main,
and then *replace* it, in the fragment transaction.  I did this
because it seems like a nice, static way to describe my application:
The main layouts, one for small, one for landscape and one for
everything else, each show the position of the fragment in the layout
XML, not in code.  The Layout API demo *adds* its fragment.  It is
never in the layout.

  The problem is that the fragments from two different sources,
mFromLayout = true and mFromLayout = false, have onCreateView called
at different times in the Activity lifecycle.  In the first case it is
called when the fragment moves from INITIALIZING to CREATED, in the
latter when it moves from CREATED to APPLICTION_CREATED.  When the app
gets restarted (because of a screen rotation) with one of the
mFrontLayout = false fragments on top of the back stack, the call to
setViewContent in Activity.onCreate ends up trying to use a fragment
that hasn't been fully initialized.

-blake

-- 
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