Code example for SparseArray

Methods: remove

0
 
    @Override 
    public void destroyItem(ViewGroup container, int position, Object object) {
        super.destroyItem(container, position, object);
 
        fragments.remove(position);
    } 
 
    @Override 
    public Object instantiateItem(ViewGroup container, int position) {
        Object fragment = super.instantiateItem(container, position);
        if (fragment instanceof IssueFragment)
            fragments.put(position, (IssueFragment) fragment);
        return fragment;
    } 
 
    @Override 
    public int getCount() { 
        return issues.length;
    }