Code example for FragmentStatePagerAdapter

0
 
public class CatalogViewPagerAdapter extends FragmentStatePagerAdapter { 
 
    private List<File> catalogPages;
    public CatalogViewPagerAdapter(FragmentManager fm, List<File> catalogPages) {
        super(fm);
        this.catalogPages = catalogPages;
    } 
 
    private Fragment fragment;
    @Override 
    public Fragment getItem(int position) {
        fragment = CatalogViewFragment.newInstance(this.catalogPages.get(position).getAbsolutePath());
        return fragment;
    } 
 
    @Override 
    public int getCount() { 
        return this.catalogPages.size();
    } 
Contextual code suggestions in your IDE  Get Codota for Java