On Fri, Jan 20, 2012 at 11:39 AM, Nick Parker <npar...@zetetic.net> wrote: > I am not exactly sure what you are suggesting. I do call > registerForContextMenu inside the onActivityCreated() method and super, but > nothing else. Are you suggesting I do something there?
I am suggesting that wherever you were calling getActivity(), and it was returning null, was too early in the fragment lifecycle. Solving that would eliminate your need to hold onto the Activity separately yourself, and it might clear up other problems that you are encountering. > The invocation of > the to perform the FragmentTransaction replace occurs from the > onContextItemSelected. Where are you getting the Fragment from that you are passing to replace()? If it not one that you instantiated just now, it may be that you are trying use a fragment that has been destroyed due to the configuration change. BTW, are you using setRetainInstance(true) with your fragments? If not, bear in mind that the fragments are destroyed and recreated during the configuration change, when the activity is destroyed and recreated. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy Android 4.0 Programming Books: http://commonsware.com/books -- 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