android.app.Dialog.onSaveInstanceState()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(5.5k)|赞(0)|评价(0)|浏览(215)

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

Dialog.onSaveInstanceState介绍

暂无

代码示例

代码示例来源:origin: ukanth/afwall

  1. @Override
  2. public Bundle onSaveInstanceState() {
  3. Bundle state = super.onSaveInstanceState();
  4. state.putInt("old_color", mOldColor.getColor());
  5. state.putInt("new_color", mNewColor.getColor());
  6. return state;
  7. }

代码示例来源:origin: SecUSo/privacy-friendly-sudoku

  1. @Override
  2. public Bundle onSaveInstanceState() {
  3. Bundle bundle = super.onSaveInstanceState();
  4. bundle.putString("hintString", hintString);
  5. bundle.putString("timeString", timeString);
  6. bundle.putBoolean("isNewBestTime", isNewBestTime);
  7. return bundle;
  8. }

代码示例来源:origin: wasdennnoch/AndroidN-ify

  1. @Override
  2. public Bundle onSaveInstanceState() {
  3. Bundle state = super.onSaveInstanceState();
  4. state.putInt("old_color", mOldColor.getColor());
  5. state.putInt("new_color", mNewColor.getColor());
  6. return state;
  7. }

代码示例来源:origin: arminha/worldclockwidget

  1. @Override
  2. public Bundle onSaveInstanceState() {
  3. Bundle state = super.onSaveInstanceState();
  4. state.putInt("old_color", mOldColor.getColor());
  5. state.putInt("new_color", mNewColor.getColor());
  6. return state;
  7. }

代码示例来源:origin: corcoran/Hangar

  1. @Override
  2. public Bundle onSaveInstanceState() {
  3. Bundle state = super.onSaveInstanceState();
  4. state.putInt("old_color", mOldColor.getColor());
  5. state.putInt("new_color", mNewColor.getColor());
  6. return state;
  7. }

代码示例来源:origin: michael-rapp/AndroidMaterialDialog

  1. @CallSuper
  2. @NonNull
  3. @Override
  4. public Bundle onSaveInstanceState() {
  5. Bundle outState = super.onSaveInstanceState();
  6. decorator.onSaveInstanceState(outState);
  7. return outState;
  8. }

代码示例来源:origin: michael-rapp/AndroidBottomSheet

  1. @NonNull
  2. @Override
  3. public final Bundle onSaveInstanceState() {
  4. Bundle outState = super.onSaveInstanceState();
  5. outState.putCharSequence(TITLE_EXTRA, title);
  6. outState.putInt(TITLE_COLOR_EXTRA, titleColor);
  7. outState.putBoolean(CANCELABLE_EXTRA, cancelable);
  8. outState.putBoolean(CANCELED_ON_TOUCH_OUTSIDE_EXTRA, canceledOnTouchOutside);
  9. outState.putFloat(DRAG_SENSITIVITY_EXTRA, dragSensitivity);
  10. outState.putFloat(DIM_AMOUNT_EXTRA, dimAmount);
  11. outState.putInt(WIDTH_EXTRA, width);
  12. if (iconBitmap != null) {
  13. outState.putParcelable(ICON_BITMAP_EXTRA, iconBitmap);
  14. } else if (iconId != -1) {
  15. outState.putInt(ICON_ID_EXTRA, iconId);
  16. }
  17. if (backgroundBitmap != null) {
  18. outState.putParcelable(BACKGROUND_BITMAP_EXTRA, backgroundBitmap);
  19. } else if (backgroundId != -1) {
  20. outState.putInt(BACKGROUND_ID_EXTRA, backgroundId);
  21. } else if (backgroundColor != -1) {
  22. outState.putInt(BACKGROUND_COLOR_EXTRA, backgroundColor);
  23. }
  24. return outState;
  25. }

代码示例来源:origin: com.google.android/support-v4

  1. @Override
  2. public void onSaveInstanceState(Bundle outState) {
  3. super.onSaveInstanceState(outState);
  4. if (mDialog != null) {
  5. Bundle dialogState = mDialog.onSaveInstanceState();
  6. if (dialogState != null) {
  7. outState.putBundle(SAVED_DIALOG_STATE_TAG, dialogState);
  8. }
  9. }
  10. if (mStyle != STYLE_NORMAL) {
  11. outState.putInt(SAVED_STYLE, mStyle);
  12. }
  13. if (mTheme != 0) {
  14. outState.putInt(SAVED_THEME, mTheme);
  15. }
  16. if (!mCancelable) {
  17. outState.putBoolean(SAVED_CANCELABLE, mCancelable);
  18. }
  19. if (!mShowsDialog) {
  20. outState.putBoolean(SAVED_SHOWS_DIALOG, mShowsDialog);
  21. }
  22. if (mBackStackId != -1) {
  23. outState.putInt(SAVED_BACK_STACK_ID, mBackStackId);
  24. }
  25. }

代码示例来源:origin: kingargyle/adt-leanback-support

  1. @Override
  2. public void onSaveInstanceState(Bundle outState) {
  3. super.onSaveInstanceState(outState);
  4. if (mDialog != null) {
  5. Bundle dialogState = mDialog.onSaveInstanceState();
  6. if (dialogState != null) {
  7. outState.putBundle(SAVED_DIALOG_STATE_TAG, dialogState);
  8. }
  9. }
  10. if (mStyle != STYLE_NORMAL) {
  11. outState.putInt(SAVED_STYLE, mStyle);
  12. }
  13. if (mTheme != 0) {
  14. outState.putInt(SAVED_THEME, mTheme);
  15. }
  16. if (!mCancelable) {
  17. outState.putBoolean(SAVED_CANCELABLE, mCancelable);
  18. }
  19. if (!mShowsDialog) {
  20. outState.putBoolean(SAVED_SHOWS_DIALOG, mShowsDialog);
  21. }
  22. if (mBackStackId != -1) {
  23. outState.putInt(SAVED_BACK_STACK_ID, mBackStackId);
  24. }
  25. }

代码示例来源:origin: jclehner/rxdroid

  1. @Override
  2. protected Parcelable onSaveInstanceState()
  3. {
  4. if(LOGV) Log.v(TAG, getKey() + ": onSaveInstanceState");
  5. final Bundle extras = new Bundle();
  6. if(mDialog != null)
  7. {
  8. extras.putBundle(EXTRA_DIALOG_STATE, mDialog.onSaveInstanceState());
  9. mDialog.dismiss();
  10. //extras.putString(EXTRA_DIALOG_VALUE, toPersistedString(getDialogValue()));
  11. }
  12. final Parcelable superState = super.onSaveInstanceState();
  13. return InstanceState.createFrom(this, superState, extras);
  14. }

代码示例来源:origin: saki4510t/libcommon

  1. @Override
  2. protected Parcelable onSaveInstanceState() {
  3. final Parcelable superState = super.onSaveInstanceState();
  4. if (mDialog == null || !mDialog.isShowing()) {
  5. return superState;
  6. }
  7. final SavedState myState = new SavedState(superState);
  8. myState.isDialogShowing = true;
  9. myState.dialogBundle = mDialog.onSaveInstanceState();
  10. return myState;
  11. }

代码示例来源:origin: AndroidDeveloperLB/MaterialPreferenceLibrary

  1. @Override
  2. protected Parcelable onSaveInstanceState() {
  3. final Parcelable superState = super.onSaveInstanceState();
  4. if (mDialog == null || !mDialog.isShowing()) {
  5. return superState;
  6. }
  7. final SavedState myState = new SavedState(superState);
  8. myState.isDialogShowing = true;
  9. myState.dialogBundle = mDialog.onSaveInstanceState();
  10. return myState;
  11. }

代码示例来源:origin: stackoverflow.com

  1. Dialog dialog = new Dialog(getActivity());
  2. dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
  3. dialog.setContentView(R.layout.dialogmap);
  4. dialog.show();
  5. GoogleMap googleMap;
  6. MapView mMapView = (MapView) dialog.findViewById(R.id.mapView);
  7. MapsInitializer.initialize(getActivity());
  8. mMapView = (MapView) dialog.findViewById(R.id.mapView);
  9. mMapView.onCreate(dialog.onSaveInstanceState());
  10. mMapView.onResume();// needed to get the map to display immediately
  11. googleMap = mMapView.getMap();

相关文章