Skip to content

onRestoreInstanceState error #6

@RoelRoel

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);)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions