In my android application I have an activity containing a Parcelable
object (implements Parcelable
).
That object contains a map.
When I try to do the following in the writeToParcel()
method:
parcel.writeMap(myMap);
I get the following comment from the API:
Please use writeBundle(Bundle) instead. Flattens a Map into the parcel at the current dataPosition(), growing dataCapacity() if needed. The Map keys must be String objects. The Map values are written using writeValue(Object) and must follow the specification there.
How am I supposed to do it?
How am I supposed to use the writeBundle(myMap)
here?