开发者

AIDL parcel usage

I've read Android Developer sites about Parcels and AIDL but I still have a question. Why can a Parcelable object be returned from an AIDL interface method but not passed as a p开发者_如何学Carameter into an AIDL method? I know that AIDL interface methods want primitive data types (as stated by the android developer website) but I am able to pass a Uri object in as a parameter - so why can I not pass a Parcelable object in?


You can pass parcelable objects using AIDL. The docs say "If you have a class that you would like to send from one process to another through an IPC interface, you can do that. However, you must ensure that the code for your class is available to the other side of the IPC channel and your class must support the Parcelable interface."

http://developer.android.com/guide/components/aidl.html#PassingObjects

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜