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
One of the possible reasons is that you have extended one of the library Views like GifTextView and overrode onSave/onRestoreInstanceState method(s) in a way that saved state received in onRestoreInstanceState is not an instance of GifViewSavedState.
To restore view state correctly pattern with passing superclass state has to be followed, eg. this is how CompoundButton from Android framework implements it. As you can see ClassCastException will also occur in analogous case with CompoundButton.
However I just discovered that some framework classes eg. TextView uses more lenient rules.
I can add similar behavior to library classes, so if you pass something which is not an instance of GifViewSavedState then state restoration will be ignored (except for calling superclass method).
If it is not the case please post more info including complete stacktrace and code snippet how you are using library classes.
Some times app crashes with class cast exception.
java.lang.ClassCastException: android.view.AbsSavedState$1 cannot be cast to pl.droidsonroids.gif.GifViewSavedState
The text was updated successfully, but these errors were encountered: