當前位置: 首頁>>代碼示例>>Java>>正文


Java FragmentManager.putFragment方法代碼示例

本文整理匯總了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);
    }
}
 
開發者ID:qiu-yongheng,項目名稱:hefengweather,代碼行數:9,代碼來源:MainActivity.java

示例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);
}
 
開發者ID:quiin,項目名稱:UnifiedContactPicker,代碼行數:8,代碼來源:ContactPickerActivity.java

示例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);
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:9,代碼來源:MainFragment.java

示例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);
}
 
開發者ID:theScrabi,項目名稱:OCBookmarks,代碼行數:8,代碼來源:MainActivity.java

示例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);
    }
}
 
開發者ID:SpeedPromise,項目名稱:L-Assistant,代碼行數:10,代碼來源:MainActivity.java

示例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);
    }
}
 
開發者ID:SpeedPromise,項目名稱:L-Assistant,代碼行數:15,代碼來源:TimelineFragment.java

示例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);
    }
}
 
開發者ID:SpeedPromise,項目名稱:L-Assistant,代碼行數:16,代碼來源:ReadFragment.java

示例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);
}
 
開發者ID:makezhao,項目名稱:LianXiZhihu,代碼行數:9,代碼來源:MainFragment.java


注:本文中的android.support.v4.app.FragmentManager.putFragment方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。