Code example for Activity

Methods: getActionBargetFragmentManager

0
        mTabsAdapter.destroyItem(mViewPager, Util.CATEGORY_TAB_INDEX,
                mTabsAdapter.getItem(Util.CATEGORY_TAB_INDEX));
        mTabsAdapter.instantiateItem(mViewPager, Util.CATEGORY_TAB_INDEX);
    } 
 
    @Override 
    public void onBackPressed() { 
        IBackPressedListener backPressedListener = (IBackPressedListener) mTabsAdapter
                .getItem(mViewPager.getCurrentItem());
        if (!backPressedListener.onBack()) {
            super.onBackPressed(); 
        } 
    } 
 
    public interface IBackPressedListener { 
        /** 
         * 处理back事件。 
         * @return True: 表示已经处理; False: 没有处理,让基类处理。 
         */ 
        boolean onBack(); 
    }