Is there an easy way to convert a Map to a Bundle in android without explicit iteration?
Why?
Firebase returns a Map for Notification getData()
. I need to pass the data to an intent. Formerly GCM gave me a bundle, so I didn't need to worry about this.
I guess a good old fashioned for loop is the easiest way:
Bundle bundle = new Bundle();
for (Map.Entry<String, String> entry : getData().entrySet()) {
bundle.putString(entry.getKey(), entry.getValue());
}