I am at a loss for this. I am switching tabs manually in my ViewPager. I have this code inside my Activity:
@Override
public void onBackPressed()
{
if (c
I had a bad time of a very similar case (same Exception in Fragment.setUserVisibleHint
) even if I used FragmentStatePagerAdapter. There was random (thus difficult to reproduce) crash of my app when the underlying datas where changed.
In my case, I finally was able to get rid of this crash by overriding the following method in the adapter :
@Override
public void restoreState(Parcelable state, ClassLoader loader) {
// don't super !
}
I do think that there's a bug in this class, given the number of questions similar to this one in StackOverflow.
I hope this could be useful to someone.
Edit : I posted a similar answer to android.support.v4.app.Fragment.setUserVisibleHint null pointer on app resuming however, I'm not positively certain that these questions are duplicate. However, I think that this answer could help some people finding these for a similar symptom. How should I note this ?