there is sth wrong with my Application,I try to add three Fragments in another Fragment,then the Eclipse show this:
java.lang.IllegalSt
Can't retain fragements that are nested in other fragments
This is a limitation of nested Fragments
. I'm guessing one or more of your child Fragments
have setRetainInstance(true)
somewhere in their code. You need to remove that to prevent the error.
EDIT: On further reading it seems if the parent Fragment
is calling setRetainInstance(true)
then it will cause the same exception due to the fact that attempting to retain the parent instance also attempts to retain the child Fragments
.