Code example for FragmentStatePagerAdapter

Methods: destroyItem

    public void destroyItem(ViewGroup container, int position, Object object) {
        // Cancel any ongoing work on the fragment 
		final ImageFragment fragment = (ImageFragment) object;
        super.destroyItem(container, position, object);
	// Ensures that new fragments are created upon add/delete 
	public int getItemPosition(Object object) {
		return PagerAdapter.POSITION_NONE; 
	public ArrayList<Uri> getPageUris() {
		return mPageUris;
Contextual code suggestions in your IDE  Get Codota for Java