I need to pass Objects
between two different processes, I read all the materials about it but I still have some questions
1.I can pass objects between different processes
through AIDL
, but its complicated and messy, I also read about he Messenger
to transfer messages, but cant I pass with it an Object
that implements Parcelable
like that?
Bundle b = new Bundle();
b.putParcelable("MyObject", (Parcelable) object);
msg.setData(b);
handler.sendMessage(msg);
And in the Handler
to extract it? if yes so what is the advance of AIDL
over Messenger
...only the multithreading issue?
2.To work across different processes
I can with Messenger
and AIDL
, but cant I use Bundle
in Activities
without all those services like some Android app work today that can get objects as input:
intent.putExtra("MyParcelableObject", object);