Code example for FragmentStatePagerAdapter

Methods: destroyItem

0
	    @Override 
        public void destroyItem(ViewGroup container, int position, Object object) { 
            final ImageDetailFragment fragment = (ImageDetailFragment) object; 
            // As the item gets destroyed we try and cancel any existing work. 
            fragment.cancelWork(); 
            super.destroyItem(container, position, object); 
        }  
	} 
 
}