Saving Fragment state in ViewPager

前端 未结 6 1381
旧巷少年郎
旧巷少年郎 2020-12-04 15:25

I tried out the sample code from the API and it didn\'t really work so I implemented my own:

FragmentPagerSupport

public class Fragm         


        
6条回答
  •  一整个雨季
    2020-12-04 16:16

    just override this method in FragmentpagerAdapter

    @Override
            public void destroyItem(ViewGroup container, int position, Object object) {
                // TODO Auto-generated method stub
                super.destroyItem(ViewGroup container, int position, Object object);
            }
    

    remove super.destroyItem(ViewGroup container, int position, Object object);

    from your code

提交回复
热议问题