Skip to content

onRestoreInstanceState error #6

Description

@RoelRoel
  /**
   * Called when Android restores the activity.
   */
  @Override
  protected void onRestoreInstanceState(Parcelable state) {
    if (state == null || !state.getClass().equals(SavedState.class)) {
      super.onRestoreInstanceState(state);
      setTheDate(((SavedState) state).dateValue);
    } else {
      SavedState s = (SavedState) state;
      super.onRestoreInstanceState(s.getSuperState());
      setTheDate(s.dateValue);
    }
  }

This gives java.lang.ClassCastException: android.view.AbsSavedState$1 cannot be cast to org.bostonandroid.datepreference.DatePreference$SavedState
at line 3 of the funciton (setTheDate(((SavedState) state).dateValue);)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions