當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。