当前位置: 首页>>代码示例>>Java>>正文


Java Fragment.getChildFragmentManager方法代码示例

本文整理汇总了Java中android.support.v4.app.Fragment.getChildFragmentManager方法的典型用法代码示例。如果您正苦于以下问题:Java Fragment.getChildFragmentManager方法的具体用法?Java Fragment.getChildFragmentManager怎么用?Java Fragment.getChildFragmentManager使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.support.v4.app.Fragment的用法示例。


在下文中一共展示了Fragment.getChildFragmentManager方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: get

import android.support.v4.app.Fragment; //导入方法依赖的package包/类
public RequestManager get(Fragment fragment) {
  Preconditions.checkNotNull(fragment.getActivity(),
        "You cannot start a load on a fragment before it is attached or after it is destroyed");
  if (Util.isOnBackgroundThread()) {
    return get(fragment.getActivity().getApplicationContext());
  } else {
    FragmentManager fm = fragment.getChildFragmentManager();
    return supportFragmentGet(fragment.getActivity(), fm, fragment);
  }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:11,代码来源:RequestManagerRetriever.java

示例2: childFragmentManager

import android.support.v4.app.Fragment; //导入方法依赖的package包/类
@Provides
@Named(CHILD_FRAGMENT_MANAGER)
@PerFragment
static FragmentManager childFragmentManager(@Named(FRAGMENT) Fragment fragment) {
    return fragment.getChildFragmentManager();
}
 
开发者ID:NamTranDev,项目名称:CleanArchitechture,代码行数:7,代码来源:BaseFragmentModule.java

示例3: getFragmentManager

import android.support.v4.app.Fragment; //导入方法依赖的package包/类
/**
 * get fragment manager
 *
 * @param fragmentActivity
 * @return
 */
private FragmentManager getFragmentManager(FragmentActivity fragmentActivity) {
    Fragment fragment = null;
    if (fragmentActivity != null && fragmentActivity.getSupportFragmentManager() != null && fragmentActivity.getSupportFragmentManager().getFragments() != null && fragmentActivity.getSupportFragmentManager().getFragments().size() > 0) {
        fragment = fragmentActivity.getSupportFragmentManager().getFragments().get(0);
    }
    if (fragment != null && fragment.getParentFragment() != null) {//必须fragment嵌套fragment才取ChildFragment
        return fragment.getChildFragmentManager();
    }

    return fragmentActivity != null ? fragmentActivity.getSupportFragmentManager() : null;
}
 
开发者ID:alibaba,项目名称:LuaViewPlayground,代码行数:18,代码来源:LVViewPager.java

示例4: addTabClildFragment

import android.support.v4.app.Fragment; //导入方法依赖的package包/类
public void addTabClildFragment(Fragment fragmentParent, Fragment fragmentChild)
{
    if (fragmentParent != null && fragmentChild != null)
    {
        FragmentManager fragmentManager = fragmentParent.getChildFragmentManager();
        clearBackStackFragmets(fragmentManager);
        FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
        fragmentTransaction.add(R.id.fragment_container, fragmentChild, fragmentChild.getClass().getCanonicalName());
        fragmentTransaction.commit();
    }
}
 
开发者ID:QuixomTech,项目名称:DeviceInfo,代码行数:12,代码来源:FragmentUtil.java

示例5: holderFragmentFor

import android.support.v4.app.Fragment; //导入方法依赖的package包/类
HolderFragment holderFragmentFor(Fragment parentFragment) {
    FragmentManager fm = parentFragment.getChildFragmentManager();
    HolderFragment holder = findHolderFragment(fm);
    if (holder != null) {
        return holder;
    }
    holder = mNotCommittedFragmentHolders.get(parentFragment);
    if (holder != null) {
        return holder;
    }

    parentFragment.getFragmentManager()
            .registerFragmentLifecycleCallbacks(mParentDestroyedCallback, false);
    holder = createHolderFragment(fm);
    mNotCommittedFragmentHolders.put(parentFragment, holder);
    return holder;
}
 
开发者ID:JessYanCoding,项目名称:LifecycleModel,代码行数:18,代码来源:HolderFragment.java


注:本文中的android.support.v4.app.Fragment.getChildFragmentManager方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。