I am using the Google compatibility library for Fragments.  I have a 
ListFragment that upon selection from a context menu performs a fragment 
transaction replace to display another fragment.  This operation works 
fine, however following a screen rotation the the commit operation fails 
giving the following exception:

java.lang.IllegalStateException: Can not perform this action after 
onSaveInstanceState

According to the documentation I should use commitAllowingStateLoss due to 
the onSaveInstanceState being called.  When I switch to the 
commitAllowingStateLoss call I get the following error:

java.lang.IllegalStateException: Activity has been destroyed

Note, in the ListFragment I am overriding the onAttach and storing a 
reference to the Activity which is provided following the screen rotation. 
 From the activity I call getSupportFragmentManager in order to perform the 
FragmentTransaction.  How is the activity becoming null?  Is this an issue 
with the compatibility library, or any I doing something wrong?  Thanks in 
advance.

Nick Parker

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

Reply via email to