Code example for FragmentStatePagerAdapter

Methods: instantiateItem

0
    } 
 
 
    @Override 
    public Object instantiateItem(ViewGroup container, int position) {
        Object fragment = super.instantiateItem(container, position);
        mCachedFragments.put(Integer.valueOf(position), (FileFragment)fragment);
        return fragment;
    } 
     
    @Override 
    public void destroyItem(ViewGroup container, int position, Object object) {
       mCachedFragments.remove(Integer.valueOf(position));
       super.destroyItem(container, position, object);
    } 
 
 
    public boolean pendingErrorAt(int position) {
        return mDownloadErrors.contains(Integer.valueOf(position));
    }