Code example for FragmentPagerAdapter

Methods: instantiateItem

0
 
    @Override 
	public Object instantiateItem(ViewGroup container, int position) 
    { 
    	Utils.Log(TAG, "instantiateItem");
    	Fragment fragment = (FragmentFeed)super.instantiateItem(container, position); /* super 필수! */
    	mPages.put(position, fragment);
		return fragment;
	} 
 
	@Override 
	public void destroyItem(ViewGroup container, int position, Object object) 
	{ 
		mPages.remove(position);
		super.destroyItem(container, position, object); /* super 필수! */
	} 
 
	/* 
	 * Listeners 
	 */ 
	@Override