now i get some logs like below (log-1)
java.lang.ClassCastException: android.widget.LinearLayout$LayoutParams cannot be cast to ClassA$1
at android.widget.LinearLayout.measureHorizontal(LinearLayout.java:1010)
...
line 1010
final LinearLayout.LayoutParams lp = (LinearLayout.LayoutParams) obj.method();//line 1010
I think ,the log should be like this (log-2)
java.lang.ClassCastException: ClassA$1 cannot be cast to android.widget.LinearLayout$LayoutParams
I wannna know that why do i get log-1,is it right?
If log-1 is right,then how can i write code to create an exception like that?
ps:I know that ClassA$1 is an anonymous class.
ps:I get this log in a monkey test,and it's vrey hard to reappear
someone tell me :
MyInterface my = ClassA$1;//$1 is an anonymous class which implements MyInterface
my.getClass().cast(lp);
then the log will be like log-1
but why the log did not point out the "cast" method line?
and i check the folder frameworks/base/core,no one call the method "? java.lang.Class.cast(Object obj)"
any ideas?
I cannot think of a logical explanation for that behaviour. If the facts are as you report them, then I agree that error message text is the wrong way around.
So what are the alternatives?
My suggestions are:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With