Code example for Fragment

Methods: setMenuVisibilitysetUserVisibleHint

0
            SurespotLog.v(TAG, "Adding item #" + itemId + ": f=" + fragment);
            mCurTransaction.add(container.getId(), fragment,
                    makeFragmentName(container.getId(), itemId));
        } 
        if (fragment != mCurrentPrimaryItem) {
            fragment.setMenuVisibility(false);
            fragment.setUserVisibleHint(false);
        } 
 
        return fragment;
    } 
 
    @Override 
    public void destroyItem(ViewGroup container, int position, Object object) {
        if (mCurTransaction == null) {
            mCurTransaction = mFragmentManager.beginTransaction();
        } 
     //   SurespotLog.v(TAG, "Detaching item #" + getItemId(position-1) + ": f=" + object 
     //           + " v=" + ((Fragment)object).getView()); 
        mCurTransaction.detach((Fragment)object);
Contextual code suggestions in your IDE  Get Codota for Java