<android.support.v4.view.ViewPager
android:id="@+id/viewpager"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
// 初始化
PagerAdapter pagerAdapter = new PagerAdapter(getSupportFragmentManager(), mSubjectList);
binding.viewpager.setAdapter(pagerAdapter);
private class PagerAdapter extends FragmentStatePagerAdapter {
public ArrayList<IssuelistBean> issueList;
public PagerAdapter(FragmentManager fm, ArrayList<IssuelistBean> fileList) {
super(fm);
this.issueList = fileList;
}
@Override
public int getCount() {
return issueList == null ? 0 : issueList.size();
}
@Override
public Fragment getItem(int position) {
IssuelistBean issue = issueList.get(position);
return Fragment_Meeting_Subject.newInstance(issue.getId());
}
}