androidx.fragment.app.Fragment.onSaveInstanceState()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(7.1k)|赞(0)|评价(0)|浏览(162)

本文整理了Java中androidx.fragment.app.Fragment.onSaveInstanceState()方法的一些代码示例,展示了Fragment.onSaveInstanceState()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Fragment.onSaveInstanceState()方法的具体详情如下:
包路径:androidx.fragment.app.Fragment
类名称:Fragment
方法名:onSaveInstanceState

Fragment.onSaveInstanceState介绍

暂无

代码示例

代码示例来源:origin: mikepenz/MaterialDrawer

@Override
  public void onSaveInstanceState(Bundle outState) {
    //add the values which need to be saved from the drawer to the bundle
    outState = result.saveInstanceState(outState);
    super.onSaveInstanceState(outState);
  }
}

代码示例来源:origin: mikepenz/MaterialDrawer

@Override
  public void onSaveInstanceState(Bundle outState) {
    //add the values which need to be saved from the drawer to the bundle
    outState = result.saveInstanceState(outState);
    super.onSaveInstanceState(outState);
  }
}

代码示例来源:origin: westnordost/StreetComplete

@Override public void onSaveInstanceState(@NonNull Bundle outState)
{
  super.onSaveInstanceState(outState);
  outState.putBoolean(SHOW_CONTROLS, isShowingControls);
}

代码示例来源:origin: westnordost/StreetComplete

@Override public void onSaveInstanceState(Bundle outState)
{
  super.onSaveInstanceState(outState);
  if(state != null) outState.putString("locationState", state.name());
  outState.putBoolean("inProgress", inProgress);
}

代码示例来源:origin: gateship-one/odyssey

@Override
public void onSaveInstanceState(@NonNull Bundle outState) {
  super.onSaveInstanceState(outState);
  // save the already typed search string (or null if nothing is entered)
  outState.putString(MYMUSICFRAGMENT_SAVED_INSTANCE_SEARCH_STRING, mSearchString);
}

代码示例来源:origin: proninyaroslav/libretorrent

@Override
public void onSaveInstanceState(@NonNull Bundle outState)
{
  outState.putString(TAG_PATH_TO_FILE_OR_DIR, pathToFileOrDir);
  outState.putInt(TAG_PIECE_SIZE, pieceSize);
  outState.putParcelable(TAG_CREATE_PARAMS, createParams);
  super.onSaveInstanceState(outState);
}

代码示例来源:origin: jruesga/rview

@Override
public void onSaveInstanceState(@NonNull Bundle outState) {
  super.onSaveInstanceState(outState);
  outState.putInt(EXTRA_CHANGE_ID, mAdapter != null ? mAdapter.mChangeId : NO_SELECTION);
  outState.putInt(Constants.EXTRA_EMPTY_STATE, mEmptyState.state);
}

代码示例来源:origin: oliexdev/openScale

@Override
public void onSaveInstanceState(Bundle outState) {
  super.onSaveInstanceState(outState);
  outState.putLong(CAL_YEARS_KEY, calYears.getTimeInMillis());
  outState.putLong(CAL_LAST_SELECTED_KEY, calLastSelected.getTimeInMillis());
}

代码示例来源:origin: proninyaroslav/libretorrent

@Override
public void onSaveInstanceState(@NonNull Bundle outState)
{
  outState.putBoolean(TAG_TORRENT_INFO_CHANGED, isTorrentInfoChanged);
  outState.putBoolean(TAG_TORRENT_FILES_CHANGED, isTorrentFilesChanged);
  outState.putString(TAG_TORRENT_ID, torrentId);
  outState.putBoolean(TAG_CHILD_IN_ACTION_MODE, childInActionMode);
  outState.putInt(TAG_CURRENT_FRAG_POS, currentFragPos);
  super.onSaveInstanceState(outState);
}

代码示例来源:origin: h6ah4i/android-tablayouthelper

@Override
public void onSaveInstanceState(Bundle outState) {
  super.onSaveInstanceState(outState);
  // save current num pages
  outState.putInt(KEY_SAVED_STATE_NUM_PAGES, mAdapter.getCount());
}

代码示例来源:origin: proninyaroslav/libretorrent

@Override
public void onSaveInstanceState(@NonNull Bundle outState)
{
  outState.putString(TAG_FEED_URL, feedUrl);
  outState.putParcelableArrayList(TAG_ITEMS, items);
  super.onSaveInstanceState(outState);
}

代码示例来源:origin: schaal/ocreader

@Override
public void onSaveInstanceState(@NonNull Bundle outState) {
  super.onSaveInstanceState(outState);
  outState.putInt(WEB_VIEW_SCROLL_POSITION, binding.webView.getScrollY());
}

代码示例来源:origin: jruesga/rview

@Override
public void onSaveInstanceState(@NonNull Bundle outState) {
  super.onSaveInstanceState(outState);
  Map<String, Integer> review = mBinding.reviewInfo.reviewLabels.getReview(false);
  outState.putString("review", SerializationManager.getInstance().toJson(review));
  outState.putString("current_revision", mCurrentRevision);
  outState.putString("diff_against_revision", mDiffAgainstRevision);
  outState.putBoolean("hideTaggedMessages", mHideTaggedMessages);
  outState.putBoolean("hideCIMessages", mHideCIMessages);
  outState.putParcelableArrayList("attachments", mAttachments);
  outState.putInt(Constants.EXTRA_EMPTY_STATE, mEmptyState.state);
}

代码示例来源:origin: proninyaroslav/libretorrent

@Override
public void onSaveInstanceState(@NonNull Bundle outState)
{
  super.onSaveInstanceState(outState);
  outState.putParcelable(TAG_BASIC_STATE, basicState);
  Bundle b = new Bundle();
  b.putParcelable(TAG_ADVANCE_STATE, advanceState);
  b.putParcelable(TAG_INFO, info);
  HeavyInstanceStorage storage = HeavyInstanceStorage.getInstance(getFragmentManager());
  if (storage != null)
    storage.pushData(HEAVY_STATE_TAG, b);
}

代码示例来源:origin: proninyaroslav/libretorrent

@Override
public void onSaveInstanceState(@NonNull Bundle outState)
{
  if (layoutManager != null)
    listPeerState = layoutManager.onSaveInstanceState();
  outState.putParcelable(TAG_LIST_PEER_STATE, listPeerState);
  outState.putParcelableArrayList(TAG_PEER_LIST, peers);
  super.onSaveInstanceState(outState);
}

代码示例来源:origin: proninyaroslav/libretorrent

@Override
public void onSaveInstanceState(@NonNull Bundle outState)
{
  super.onSaveInstanceState(outState);
  outState.putString(TAG_DOWNLOAD_DIR, downloadDir);
  outState.putString(TAG_CUSTOM_NAME, customName);
  Bundle b = new Bundle();
  b.putParcelable(TAG_INFO, info);
  HeavyInstanceStorage storage = HeavyInstanceStorage.getInstance(getFragmentManager());
  if (storage != null)
    storage.pushData(HEAVY_STATE_TAG, b);
}

代码示例来源:origin: AlexMofer/ProjectX

@Override
public void onSaveInstanceState(@NonNull Bundle outState) {
  super.onSaveInstanceState(outState);
  final AMPresenter presenter = getPresenter();
  if (presenter != null) {
    presenter.onSaveInstanceState(outState);
  }
}

代码示例来源:origin: proninyaroslav/libretorrent

@Override
public void onSaveInstanceState(@NonNull Bundle outState)
{
  outState.putParcelable(TAG_PREV_IMPL_INTENT, prevImplIntent);
  outState.putIntegerArrayList(TAG_SELECTABLE_ADAPTER, adapter.getSelectedItems());
  outState.putBoolean(TAG_IN_ACTION_MODE, inActionMode);
  outState.putStringArrayList(TAG_SELECTED_TORRENTS, selectedTorrents);
  torrentsListState = layoutManager.onSaveInstanceState();
  outState.putParcelable(TAG_TORRENTS_LIST_STATE, torrentsListState);
  super.onSaveInstanceState(outState);
}

代码示例来源:origin: proninyaroslav/libretorrent

@Override
public void onSaveInstanceState(@NonNull Bundle outState)
{
  outState.putParcelable(TAG_PREV_IMPL_INTENT, prevImplIntent);
  if (layoutManager != null)
    channelListState = layoutManager.onSaveInstanceState();
  outState.putParcelable(TAG_CHANNEL_LIST_STATE, channelListState);
  if (adapter != null)
    outState.putIntegerArrayList(TAG_SELECTABLE_ADAPTER, adapter.getSelectedItems());
  outState.putBoolean(TAG_IN_ACTION_MODE, inActionMode);
  outState.putParcelableArrayList(TAG_SELECTED_CHANNELS, selectedChannels);
  super.onSaveInstanceState(outState);
}

代码示例来源:origin: esafirm/android-image-picker

@Override
public void onSaveInstanceState(Bundle outState) {
  super.onSaveInstanceState(outState);
  outState.putSerializable(STATE_KEY_CAMERA_MODULE, presenter.getCameraModule());
  if (!isCameraOnly) {
    outState.putParcelable(STATE_KEY_RECYCLER, recyclerViewManager.getRecyclerState());
    outState.putParcelableArrayList(STATE_KEY_SELECTED_IMAGES, (ArrayList<? extends Parcelable>)
        recyclerViewManager.getSelectedImages());
  }
}

相关文章