I started to develop an xposed module but now I get a strange error. I used
RecyclerView player_recycler_view=(RecyclerView)card_content.getChildAt(2)
to get the RecyclerView. card_content
is the parent of the RecyclerView.
I get this error
java.lang.ClassCastException: android.support.v7.widget.RecyclerView cannot be cast to android.support.v7.widget.RecyclerView
It makes no sense! With the others child of card_content
everything is working fine.
Thank you in advance!
@Andrew Sun should be correct, I have observed this pattern before for android.support
classes.
Try to compare both classloaders:
if (RecyclerView.class.getClassLoader() == card_content.getChildAt(2).getClass().getClassLoader()) {
Log.v(TAG, "Same classloader");
} else {
Log.v(TAG, "Another classloader");
}
If they are indeed from different class loaders, using getClass
on the card_content.getChildAt(2)
and reflection you should be able to invoke on its methods.