You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/** 关联ViewPager,用于连适配器都不想自己实例化的情况 */
public void setViewPager(ViewPager vp, String[] titles, FragmentActivity fa, ArrayList fragments) {
if (vp == null) {
throw new IllegalStateException("ViewPager can not be NULL !");
}
if (titles == null || titles.length == 0) {
throw new IllegalStateException("Titles can not be EMPTY !");
}
this.mViewPager = vp;
this.mViewPager.setAdapter(new InnerPagerAdapter(fa.getSupportFragmentManager(), fragments, titles));
this.mViewPager.removeOnPageChangeListener(this);
this.mViewPager.addOnPageChangeListener(this);
notifyDataSetChanged();
}
重写修改为:
public void setViewPager(ViewPager vp, String[] titles, FragmentManager fa, ArrayList fragments) {
if (vp == null) {
throw new IllegalStateException("ViewPager can not be NULL !");
}
if (titles == null || titles.length == 0) {
throw new IllegalStateException("Titles can not be EMPTY !");
}
this.mViewPager = vp;
this.mViewPager.setAdapter(new MSlidingTabLayout.InnerPagerAdapter(fa, fragments, titles));
this.mViewPager.removeOnPageChangeListener(this);
this.mViewPager.addOnPageChangeListener(this);
notifyDataSetChanged();
}
The text was updated successfully, but these errors were encountered:
SlidingTabLayout 在Fragment 嵌套 Fragment 的时候无法使用!!!
/** 关联ViewPager,用于连适配器都不想自己实例化的情况 */
public void setViewPager(ViewPager vp, String[] titles, FragmentActivity fa, ArrayList fragments) {
if (vp == null) {
throw new IllegalStateException("ViewPager can not be NULL !");
}
重写修改为:
public void setViewPager(ViewPager vp, String[] titles, FragmentManager fa, ArrayList fragments) {
if (vp == null) {
throw new IllegalStateException("ViewPager can not be NULL !");
}
The text was updated successfully, but these errors were encountered: