I'm writing an Android Service which is intended to be bound by other Applications. It uses a Messenger
as IBinder
.
Now I've stumpled upon a Problem: If I want to send a Message
with only a what
and a String
I originally planned to use Message.obj
for it.
This doesn't work as the documentation states:
When using Messenger to send the message across processes this can only be non-null if it contains a Parcelable of a framework class (not one implemented by the application). For other data transfer use setData(Bundle).
This raises two (related) questions:
- Why is a
String
notParcelable
in Android? - Is there a more "elegant" solution than to create a Bundle for it and set my String there?