Thursday, December 24, 2015

Viewpager pageradapter 刷新数据的时候 ViewPager 并没有刷新

解决方案:


public class ScrollMainImageAdapter extends FragmentStatePagerAdapter implements
        IconPagerAdapter, ImageFragment.OnImageClickListener {



//  只要实现了这个方法就OK了

@Override
public int getItemPosition(Object object) {
    return POSITION_NONE;
}



1  http://www.cnblogs.com/lianghui66/p/3607091.html

2  http://stackoverflow.com/questions/11756102/java-lang-illegalstateexception-fragement-no-longer-exists-for-key-f1-index-3

No comments:

Post a Comment