You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/**
* 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);)
The text was updated successfully, but these errors were encountered:
RoelRoel
changed the title
onRestoreInstanceState is not logical
onRestoreInstanceState error
Feb 9, 2016
I get the same error when rotating Activity with Fragment containing DatePreference.
I'm trying to run with following code (unfortunately I don't fully understand the reason for creating the class SavedState when there is only one attribute and why there is different handling when isPersistent() is true). This is only a blind try...
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);
)The text was updated successfully, but these errors were encountered: