Passing Objects in IPC using Messenger in Android

北城余情 提交于 2019-12-11 17:51:40

问题


I am using Messenger instead of aidl in Android for IPC. I have a service with which clients can bind . How can i pass a custom object form service to a client using Messenger Mechanism for IPC so that client can use that object to invoke operations.I know we can send simple data types using Parcelable or databundle but what about custom objects


回答1:


How can i pass a custom object form service to a client using Messenger Mechanism for IPC so that client can use that object to invoke operations.

You can't. Apps in one process cannot hold objects from another process, let alone "invoke operations" upon them.



来源:https://stackoverflow.com/questions/12599410/passing-objects-in-ipc-using-messenger-in-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!