Code example for FragmentStatePagerAdapter

Methods: destroyItem

0
    public void destroyItem(ViewGroup container, int position, Object object) {
        // Cancel any ongoing work on the fragment 
		final ImageFragment fragment = (ImageFragment) object;
        fragment.cancelWork();
         
        super.destroyItem(container, position, object);
    } 
	 
	// Ensures that new fragments are created upon add/delete 
	@Override 
	public int getItemPosition(Object object) {
		return PagerAdapter.POSITION_NONE; 
	} 
	 
	public ArrayList<Uri> getPageUris() {
		return mPageUris;
	} 
}