I'm using the FragmentStatePagerAdapter in a ViewPager, in order to provide 
mutable content (FragmentPagerAdapter didn't work, it was not possible to 
change the content after having set it the first time).

Mainly it works, but it crashes frequently because of 
IllegalStateExceptions: "Fragment no longer exists" / "No view found for id 
0xcf for fragment" / "Fragment is no longer in the fragment manager" (and 
forgot the 4th one). There's nothing directly related to my code in the 
stack trace, all I know, is that it's somehow related with saving / 
restoring state, and trying to access not existing fragments.

The documentation in 
http://developer.android.com/reference/android/support/v4/app/FragmentStatePagerAdapter.html
 doesn't 
give my any help, the description and example is very basic and don't say 
anything about having to care about saving / restoring fragment's state. 
And I don't have time to study all the source.

All the documentation says about requeriments is:

"When using FragmentPagerAdapter the host ViewPager must have a valid ID 
set.

Subclasses only need to implement 
getItem(int)<http://developer.android.com/reference/android/support/v4/app/FragmentStatePagerAdapter.html#getItem(int)>
 and 
getCount()<http://developer.android.com/reference/android/support/v4/view/PagerAdapter.html#getCount()>
 to 
have a working adapter."

I'm doing that. 

Can somebody help me out of this, at least giving me a logical background 
of these problems and what am I supposed to to? 

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