Code example for FragmentStatePagerAdapter

Methods: destroyItem

0
 
    @Override 
    public void destroyItem(ViewGroup aContainer, int aPosition, Object aObject)
    { 
        mPageReferenceMap.remove(aPosition);
        super.destroyItem(aContainer, aPosition, aObject);
    } 
 
    public TaskFragment getFragment(int aPosition)
    { 
        return mPageReferenceMap.get(aPosition);
    } 
 
    public ArrayList<Task> getData()
    { 
        return mData;
    } 
}