Let me describe my project.
I use actionbarsherlock with SlidingMeno from jfeinstein10 . On my main activity i have this sliding menu with a couple of menu item that open Fragments in container. (the same as basic fragment sample in sliding menu example) In one of those fragments i have view-pager with viewpageindicator. View-pager is tied up to FragmentStatePagerAdapter with my fragments. So i have fragments inside fragments. I use getChildFragmentManager() like suggested in the doc, when using fragments inside fragments.
When i select menu item with fragment that hold view-pager for the first time everything work like it should. But when i select some other menu item and then go back to this view-pager fragment i get this exception.
All other fragments don’t have this problem and in stack trace there is no reference to my code.
https://gist.github.com/4502038
Did any one encounter similar problem or have some idea what is going on.
EDIT: If i use getFragmentManager() instead of getChildFragmentManager() even thou i’m in subfragment. I don’t get an exception, but one of the fragments inside viewpager doesn’t get recreated after i select viewpager fragment for the second time.
I created a project on github so you guys can take a look.
https://github.com/pzagor2/TestErrorApp
See this: https://code.google.com/p/android/issues/detail?id=42601 bug.
Uncommenting addToBackStack https://github.com/pzagor2/TestErrorApp/blob/master/MainActivity/src/com/example/myapp/MainActivity.java#L69 , worked for me with your project setup.
You can see the bug in the Google bug report in the first URL.
Hope this helped.