本文整理汇总了Java中android.support.v4.app.FragmentManager.putFragment方法的典型用法代码示例。如果您正苦于以下问题:Java FragmentManager.putFragment方法的具体用法?Java FragmentManager.putFragment怎么用?Java FragmentManager.putFragment使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.support.v4.app.FragmentManager
的用法示例。
在下文中一共展示了FragmentManager.putFragment方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onSaveInstanceState
import android.support.v4.app.FragmentManager; //导入方法依赖的package包/类
@Override
protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
FragmentManager manager = getSupportFragmentManager();
if (chooseFragment.isAdded()) {
manager.putFragment(outState, "chooseFragment", chooseFragment);
}
}
示例2: onSaveInstanceState
import android.support.v4.app.FragmentManager; //导入方法依赖的package包/类
@Override
protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
FragmentManager fragmentManager = getSupportFragmentManager();
if(fragmentManager != null)
fragmentManager.putFragment(outState, FRAGMENT_KEY , mFragment);
}
示例3: onSaveInstanceState
import android.support.v4.app.FragmentManager; //导入方法依赖的package包/类
@Override
public void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
FragmentManager manager = getChildFragmentManager();
manager.putFragment(outState, "zhihu", zhihuDailyFragment);
manager.putFragment(outState, "guokr", guokrFragment);
manager.putFragment(outState, "douban", doubanMomentFragment);
}
示例4: onSaveInstanceState
import android.support.v4.app.FragmentManager; //导入方法依赖的package包/类
@Override
public void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
FragmentManager fm = getSupportFragmentManager();
fm.putFragment(outState, BOOKMARK_FRAGMENT, mBookmarkFragment);
fm.putFragment(outState, TAGS_FRAGMENT, mTagsFragment);
}
示例5: onSaveInstanceState
import android.support.v4.app.FragmentManager; //导入方法依赖的package包/类
@Override
protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
outState.putInt(KEY_DRAWER_NAV_VIEW_SELECTED_ID, resideMenu.getId());
FragmentManager fm = getSupportFragmentManager();
if(mReadFragment.isAdded()){
fm.putFragment(outState, ReadFragment.class.getSimpleName(), mReadFragment);
}
}
示例6: onSaveInstanceState
import android.support.v4.app.FragmentManager; //导入方法依赖的package包/类
@Override
public void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
FragmentManager fm = getChildFragmentManager();
if (mZhihuFragment.isAdded()) {
fm.putFragment(outState, ZhihuDailyFragment.class.getSimpleName(), mZhihuFragment);
}
if (mGuokrFragment.isAdded()) {
fm.putFragment(outState, DoubanMomentFragment.class.getSimpleName(), mDoubanFragment);
}
if (mDoubanFragment.isAdded()) {
fm.putFragment(outState, GuokrHandpickFragment.class.getSimpleName(), mGuokrFragment);
}
}
示例7: onSaveInstanceState
import android.support.v4.app.FragmentManager; //导入方法依赖的package包/类
@Override
public void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
outState.putInt(KEY_BOTTOM_NAV_VIEW_SELECTED_ID, mBottomNavigationView.getSelectedItemId());
FragmentManager fm = getChildFragmentManager();
if (mTimelineFragment.isAdded()) {
fm.putFragment(outState, TimelineFragment.class.getSimpleName(), mTimelineFragment);
}
if (mFavoritesFragment.isAdded()) {
fm.putFragment(outState, FavoritesFragment.class.getSimpleName(), mFavoritesFragment);
}
if (mInfoFragment.isAdded()) {
fm.putFragment(outState, InfoReadFragment.class.getSimpleName(), mInfoFragment);
}
}
示例8: onSaveInstanceState
import android.support.v4.app.FragmentManager; //导入方法依赖的package包/类
@Override
public void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
FragmentManager manager = getChildFragmentManager();
manager.putFragment(outState, "zhihu", zhihuDailyFragment);
//manager.putFragment(outState, "guokr", guokrFragment);
manager.putFragment(outState, "douban", doubanMomentFragment);
}