Live2D

IBinder进行向下类型转换发生ClassCastException的可能原因

参考.https://stackoverrun.com/cn/q/3910896

1、If service to bind is in different process with the caller, you should use AIDL interface.

即:如果要绑定的服务与调用者在不同的进程中,你应该使用AIDL接口。(由于我才学到IBinder的地方,不了解AIDL接口,所以无法找到具体的例子)

2、虽然你建了个类A      A extends Binder      但是你在IBinder的返回语句中   return new Binder()了,而不是 return new A().(这是我错误的原因)

posted @ 2020-12-21 13:39  幽香飞狐  阅读(73)  评论(0)    收藏  举报
Live2D