/** Called when Android restores the activity. */
 @Override
 protected void onRestoreInstanceState(Parcelable state) {
   if (state == null || !state.getClass().equals(SavedState.class)) {
     super.onRestoreInstanceState(state);
     setTheTime(((SavedState) state).dateValue);
   } else {
     SavedState s = (SavedState) state;
     super.onRestoreInstanceState(s.getSuperState());
     setTheTime(s.dateValue);
   }
 }
  @Override
  protected void onRestoreInstanceState(Parcelable state) {
    if (state == null || !state.getClass().equals(SavedState.class)) {
      // Didn't save state for us in onSaveInstanceState
      super.onRestoreInstanceState(state);
      return;
    }

    SavedState myState = (SavedState) state;
    super.onRestoreInstanceState(myState.getSuperState());
    setValue(myState.value);
  }
    @Override
    protected void onRestoreInstanceState(Parcelable state) {
      if (!(state instanceof SavedState)) {
        super.onRestoreInstanceState(state);
        return;
      }

      final SavedState myState = (SavedState) state;
      super.onRestoreInstanceState(myState.getSuperState());
      setSpinnerPosition(mSubtypeLocaleSpinner, myState.mSubtypeLocaleSelectedPos);
      setSpinnerPosition(mKeyboardLayoutSetSpinner, myState.mKeyboardLayoutSetSelectedPos);
      setSubtype(myState.mSubtype);
    }
  @Override
  protected void onRestoreInstanceState(Parcelable state) {
    // Check whether we saved the state in onSaveInstanceState
    if (state == null || !state.getClass().equals(SavedState.class)) {
      // Didn't save the state, so call superclass
      super.onRestoreInstanceState(state);
      return;
    }

    // Cast state to custom BaseSavedState and pass to superclass
    SavedState myState = (SavedState) state;
    super.onRestoreInstanceState(myState.getSuperState());
  }
  @Override
  protected void onRestoreInstanceState(Parcelable state) {
    if (state == null || !state.getClass().equals(SavedState.class)) {
      // Didn't save state for us in onSaveInstanceState
      super.onRestoreInstanceState(state);
      return;
    }

    SavedState myState = (SavedState) state;
    super.onRestoreInstanceState(myState.getSuperState());
    if (myState.isDialogShowing) {
      showDialog(myState.dialogBundle);
    }
  }
 /** Called when Android restores the activity. */
 @Override
 protected void onRestoreInstanceState(Parcelable state) {
   try {
     if (state == null || !state.getClass().equals(SavedState.class)) {
       super.onRestoreInstanceState(state);
       setTheTime(((SavedState) state).dateValue);
     } else {
       SavedState s = (SavedState) state;
       super.onRestoreInstanceState(s.getSuperState());
       setTheTime(s.dateValue);
     }
   } catch (Exception e) {
     Log.e(TimePreference.class.getSimpleName(), e.getMessage());
   }
 }
 @Override
 protected void onRestoreInstanceState(Parcelable state) {
   SavedLevels levelsState = (SavedLevels) state;
   levels = levelsState.levels;
   initialLevels = levelsState.initialLevels;
   super.onRestoreInstanceState(levelsState.getSuperState());
 }
  @Override
  protected void onRestoreInstanceState(Parcelable state) {
    if (!(state instanceof SavedState)) {
      super.onRestoreInstanceState(state);
      return;
    }

    // get saved state
    SavedState savedState = (SavedState) state;
    super.onRestoreInstanceState(savedState.getSuperState());

    // set saved state to the class variables
    this.mSelectedDate = new DateTime(savedState.stateToSave);

    // is this necessary?
    // notifyChanged();
  }
  @Override
  protected void onRestoreInstanceState(Parcelable state) {
    Bundle bundle = (Bundle) state;
    super.onRestoreInstanceState(bundle.getParcelable(STATE_KEY_SUPER));
    mSeekBarValue = bundle.getInt(STATE_KEY_SEEK_BAR_VALUE);

    callChangeListener((float) mSeekBarValue / SEEKBAR_RESOLUTION);
  }
  @Override
  protected void onRestoreInstanceState(Parcelable state) {
    // check whether we saved the state in onSaveInstanceState()
    if (state == null || !state.getClass().equals(SavedState.class)) {
      // didn't save the state, so call superclass
      super.onRestoreInstanceState(state);
      return;
    }

    // restore the state
    SavedState myState = (SavedState) state;
    setMinValue(myState.minValue);
    setMaxValue(myState.maxValue);
    setValue(myState.value);

    super.onRestoreInstanceState(myState.getSuperState());
  }
  @Override
  protected void onRestoreInstanceState(Parcelable state) {
    if (state == null || !state.getClass().equals(SavedState.class)) {
      // Didn't save state for us in onSaveInstanceState
      super.onRestoreInstanceState(state);
      return;
    }

    SavedState myState = (SavedState) state;
    super.onRestoreInstanceState(myState.getSuperState());
    mOriginalColors = myState.originalColors;
    mCurrentColors = myState.currentColors;
    for (int i = 0; i < mSeekBars.length; i++) {
      mSeekBars[i].setValueFromString(mCurrentColors[i]);
    }
    DisplayColorCalibration.setColors(TextUtils.join(" ", mCurrentColors));
  }