Code example for FragmentPagerAdapter

Methods: destroyItem

0
    	//return fragments.get(Integer.valueOf(position)); 
	} 
 
	@Override 
	public void destroyItem(ViewGroup container, int position, Object object) { 
	    super.destroyItem(container, position, object); 
	    fragments.remove(position); 
	} 
 
	/* (non-Javadoc) 
	 * @see android.support.v4.view.PagerAdapter#getCount() 
	 */ 
	@Override 
	public int getCount() { 
		return 3; 
		//return fragments.size(); 
	} 
 
    @Override 
	public String getPageTitle(int position) { 
    	return TITLES[position];