I\'m trying to make an app that has a ViewPager
in a Fragment that is part of a TabHost
. Everything works out fine. I have my tabbar, I can switch
you should use getChildFragmentManager()
instead of getFragmentManager()
and FragmentStatePagerAdapter()
instead of FragmentPagerAdapter()
.Hope it will be useful for someone.
I been searching
this for long finally found a solution.Change your page adapter instance FragmentPagerAdapter
to FragmentStatePagerAdapter
example:
class PageAdapter extends FragmentStatePagerAdapter {
I found the problem. It took me two days, but hey, it's fixed.
Instead of using
mAdapter = new AlbumAdapter(getFragmentManager(), mActiveProject.getInspiration());
You should use
mAdapter = new AlbumAdapter(getChildFragmentManager(), mActiveProject.getInspiration());
So much for 5 characters.