On Mar 26, 7:53 pm, 冰咖啡不加糖 <[email protected]> wrote:
> but if use MyInterface instance =  (MyInterface)  o;
> it failed:  java.lang.ClassCastException: com.mygame.Race

The exception means that "o" is an instance of com.mygame.Race, and
cannot be cast to an instance of MyInterface.  This would happen if
"o" sees a different instance of MyInterface, e.g. if there were
"MyInterface" declarations in both class loaders.  You may want to do
a quick check with "dexdump" to ensure that it only appears in one
place, and possibly do some reflection calls to ensure that the
interfaces "o" implements are what you expect at run time.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to