Android-aidl传输parceble数据错误

写了一个service,使用AIDL跨进程调用时出现问题,service这边写的数据是正确的,client端拿到的是默认值,都是0.

找了下,

http://stackoverflow.com/questions/24615317/android-aidl-and-service-and-activity-parceable-seems-to-be-passing-default-clas

因为 in  out写反了。

in表示这个参数是入参,会被这个method读,但不会写。out意味着这个method会写但不读。inout表示会读也会写。

in/out/inout从字面意思上很好理解,要记住,它们是修饰参数,in/out都是相对于当前method的。

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注