本文整理匯總了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;
}