Fragment getChildFragmentManager - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Fragment getChildFragmentManager method.

This code example shows how to use the following methods:getActivity, getChildFragmentManager
 
    return(result);
  } 
 
  private PagerAdapter buildAdapter() { 
    return(new SampleAdapter(getActivity(), getChildFragmentManager()));
  } 
} 
8
CodeRank
This code example shows how to use the following methods:getChildFragmentManager, onCreate, setHasOptionsMenu
    public static class Menu2Fragment extends Fragment {
        Menu3Fragment mFragment3;
 
        @Override 
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setHasOptionsMenu(true);
 
            FragmentManager fm = getChildFragmentManager();
            FragmentTransaction ft = fm.beginTransaction();
            mFragment3 = (Menu3Fragment)fm.findFragmentByTag("f3");
            if (mFragment3 == null) {
                mFragment3 = new Menu3Fragment();
                ft.add(mFragment3, "f3");
            } 
            ft.commit();
        } 
 
        @Override 
        public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
5
CodeRank
This code example shows how to use the following methods:getChildFragmentManager
    /** 
     * Pop fragment backstack. 
     * @return return true if exists backstack 
     */ 
    public boolean popBackStack() { 
        return getChildFragmentManager().popBackStackImmediate();
    } 
 
    /** 
     * Initialize Fragment. 
     */ 
    private void initFragment() { 
 
        Bundle args = getArguments();
        String rootClass = args.getString(TabNyanActivity.ROOT_FRAGMENT_ARGS);
 
        FragmentManager fragmentManager = getChildFragmentManager();
        if (fragmentManager.findFragmentById(R.id.fragment) != null) {
            return; 
        } 
4
CodeRank
This code example shows how to use the following methods:getChildFragmentManager
     * BackStackがあった場合はtrue, なかった場合はfalseを返す 
     * 
     * @return true:BackStackあり false:BackStackなし 
     */ 
    public boolean popBackStack() { 
        return getChildFragmentManager().popBackStackImmediate();
    } 
 
    /** 
     * BackStackをクリア 
     */ 
    public void clearBackStack() { 
        getChildFragmentManager().popBackStack(null, FragmentManager.POP_BACK_STACK_INCLUSIVE);
    } 
 
    /** 
     * 初期Fragmentを設定. 
     * @param rootClass 初期Fragmentクラス名 
     */ 
    private void initFragment(String rootClass) {
4
CodeRank
This code example shows how to use the following methods:getChildFragmentManager
		} 
		 
	} 
 
	public void pop(){ 
		getChildFragmentManager().popBackStack();
	} 
	 
	public int getFragmentCount(){ 
		return getChildFragmentManager().getBackStackEntryCount();
	} 
 
	@Override 
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		View view = inflater.inflate(R.layout.container_fragment, container, false);
		return view;
	} 
 
} 
4
CodeRank
This code example shows how to use the following methods:getChildFragmentManager
			return wrapper;
		} 
 
		@Override 
		public void onInputReceived(String data) {
			InputContent inc = (InputContent) getChildFragmentManager()
					.findFragmentByTag(INPUT_CONTENT_TAG);
			getChildFragmentManager().beginTransaction().remove(inc).commit();
			final InitialContent ic = (InitialContent) getChildFragmentManager()
					.findFragmentByTag(INITIAL_CONTENT_TAG);
			ic.update(data);
		} 
 
		@Override 
		public void onNewInputRequired() { 
			InputContent ic = new InputContent();
			getChildFragmentManager().beginTransaction()
					.add(R.id.newContent, ic, INPUT_CONTENT_TAG).commit();
		} 
 
3
CodeRank

Related Fragment getChildFragmentManager Questions & Answers:

getChildFragmentManager Method Overview
Return a private FragmentManager for placing and managing Fragments inside of this Fragment.
See Code Examples for other Android Fragment Methods: