本文整理汇总了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);
}
}
示例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();
}
示例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;
}
示例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();
}
}
示例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;
}