Closed josluimg closed 8 years ago
I'm facing the same error on: Android 4.0.3 - 4.0.4, HUAWEI U9508 (hwu9508)
did you find a solution or a workaround to solve this?
Ok, i found how to avoid (line 200) this:
if(generateDefaultLayoutParams() instanceof LayoutParams) {
layoutParams = (LayoutParams) generateDefaultLayoutParams();
}
else{
layoutParams = new AbsListView.LayoutParams(AbsListView.LayoutParams.MATCH_PARENT,AbsListView.LayoutParams.WRAP_CONTENT, 0);
}
I got same error on Android 4.0.4, SAMSUNG GT-S7562i. And @gianpaolodn solution worked perfectly, thank you!
I got same error on Android 2.2 emulator
Because pinnedView.getLayoutParams()
, generateDefaultLayoutParams()
return ViewGroup.LayoutParams
and not LayoutParams
, we need to set type of layoutParams
to ViewGroup.LayoutParams
ViewGroup.LayoutParams layoutParams = (ViewGroup.LayoutParams) pinnedView.getLayoutParams();
if (layoutParams == null) {
layoutParams = (ViewGroup.LayoutParams) generateDefaultLayoutParams();
pinnedView.setLayoutParams(layoutParams);
}
Changes are done here.
My app got some java.lang.ClassCastException on some devices. I don't altered the code of the lib. Errors from Google Play:
Errors on: Android 4.0.3 - 4.0.4, Xperia Tipo (ST21i), Xperia U (ST25i)