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