Best code examples for Fragment setUserVisibleHint method (android.app.Fragment.setUserVisibleHint)

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Fragment setUserVisibleHint method.
You can now enable Codota on your own code to easily search and navigate your Java codebase.

Fragment setUserVisibleHint examples from Open Source projects
This code example shows how to use the following methods: setRetainInstance, setUserVisibleHint
public class SupportSelectionStateFragment extends Fragment implements SelectionState {
 
  private CommonSelectionStateFragment _common = new CommonSelectionStateFragment();
 
  public SupportSelectionStateFragment() { 
    super(); 
    setRetainInstance(true);
    setUserVisibleHint(false);
  } 
 
  @Override 
  public void onSaveInstanceState(final Bundle state) {
    super.onSaveInstanceState(state);
    _common.onSaveInstanceState(state);
  } 
 
  @Override 
  public void onCreate(final Bundle state) {
    super.onCreate(state);
    _common.onCreate(state);
Full Snippet Info
10
CodeRank
This code example shows how to use the following methods: setMenuVisibility, setUserVisibleHint
//                    makeFragmentName(container.getId(), itemId)); 
            mCurTransaction.add(container.getId(), fragment,
                    getTag(position));
        } 
        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();
        } 
        if (DEBUG) Log.v(TAG, "Detaching item #" + getItemId(position) + ": f=" + object
                + " v=" + ((Fragment) object).getView());
        mCurTransaction.detach((Fragment) object);
Full Snippet Info
9
CodeRank
This code example shows how to use the following methods: setMenuVisibility, setUserVisibleHint
            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);
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setUserVisibleHint
package com.teamboid.twitter.compat; 
 
import android.annotation.TargetApi; 
import android.app.Fragment; 
import android.os.Build; 
 
@TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH_MR1)
public class Api15 { 
 
	public static void setUserVisibleHint(Fragment fragment, boolean b) {
		fragment.setUserVisibleHint(b);
	} 
 
} 

6
CodeRank
This code example shows how to use the following methods: setMenuVisibility, setUserVisibleHint
Related Fragment setUserVisibleHint Questions & Answers:
setUserVisibleHint Method Overview
Set a hint to the system about whether this fragment's UI is currently visible to the user.
See Code Examples for other Android Fragment Methods: