Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update restore instance state to avoid 'wrong state class' exception. #4

Merged
merged 1 commit into from Jul 21, 2017

Conversation

jwmach1
Copy link
Collaborator

@jwmach1 jwmach1 commented Jul 20, 2017

The current implementation of onRestoreInstanceState causes the following exception. By checking the type of the saved state we avoid this problem and use the superState when necessary. I loosely followed the example from Tricky Android keeping the if condition you started with (as I've done on other custom controls)

Wrong state class, expecting View State but received class com.whygraphics.multilineradiogroup.MultiLineRadioGroup$SavedState instead. This usually happens when two views of different type have the same id in the same hierarchy. This view's id is NO_ID. Make sure other views do not use the same id

@jwmach1 jwmach1 merged commit 50fb7a6 into Gavras:master Jul 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant