-
Notifications
You must be signed in to change notification settings - Fork 96
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
Crash when returning to fragment as a tab. View with same id #28
Comments
Same issue here. Except i'm not using fragments. I have a HeaderListView in one of my activities and i am now receiving this on GooglePlay every once in a while:
I believe i am using the latest version of HeaderListView. |
I had the same issue, where I am using HeaderListView inside a fragment and my application crashes every time when switching between Landscape and Portrait Orientation.
The id here can be anything. |
Another solution is to use tag instead of id. Your layout file <com.applidium.headerlistview.HeaderListView
android:tag="yourTag"
android:layout_width="match_parent"
android:layout_height="match_parent" /> Your java file HeaderListView yourListView = (HeaderListView) findViewWithTag("yourTag"); |
Same problem here when using DialogFragment. It also seem to appear only on specific devices. I cannot reproduce it on LG G4, but I can on Nexus 4 for example. I think it can be fixed easily according to this StackOverflow post: http://stackoverflow.com/questions/24297279/wrong-state-class-expecting-view-state-but |
And this post is also related to this issue: |
This stackoverflow post has more details and the workaround: http://stackoverflow.com/questions/25807332/crash-when-returning-to-fragment-as-a-tab-view-with-same-id
With two tabs (A & B fragment using HeaderListView), when switching from B to A back to B, the app crashes with
java.lang.IllegalArgumentException: Wrong state class, expecting View State but received class android.widget.AbsListView$SavedState instead. This usually happens when two views of different type have the same id in the same hierarchy. This view's id is id/header_list_view. Make sure other views do not use the same id.
Other views are not using the same ID and to fix this issue I can
listview.setId()
inonCreateView
to anything.The text was updated successfully, but these errors were encountered: