koleton
koleton copied to clipboard
Two views has same id error
Hi, The following error is occurring.
Fatal Exception: java.lang.IllegalArgumentException Wrong state class, expecting View State but received class androidx.recyclerview.widget.RecyclerView$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/rv_popular_show. Make sure other views do not use the same id.
Hi, Getting the following error for all RecyclerView implementation after adding this library. `View.java line
Caused by java.lang.IllegalArgumentException Wrong state class, expecting View State but received class androidx.recyclerview.widget.RecyclerView$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/recyclerToday. Make sure other views do not use the same id.`
Hi @smhdk @AchleshK
Sorry for the late reply.
I couldn't reproduce this issue. Can you please provide more information about your code?
Thank you for your feedback. It is appreciated.
Same issue here.
Just call loadSkeleton()
method on a recyclerView in FragmentA. navigate from FragmentA to FragmentB. and then when press back button to come back to FragmentA, this exception occures.
Please tell me if you need more info
I'm getting the same error. The scenario is the same as reported by @babak-gholampour.
Found workaround: add android:saveEnabled="false"
to RecyclerView
This is happening in BottomNavigationView as well and when you change the theme, so a recreation happens the issue occurs there as well.
Same issue with same behavior.