Skip to content

Instantly share code, notes, and snippets.

Avatar

Andrei Bacalu androuis

View GitHub Profile
View Kotlin Interview Questions.md
@androuis
androuis / CollectionUtils.java
Created April 7, 2017 11:39 — forked from mmarcon/CollectionUtils.java
Maps are not Parcelable and this is an issue in Android when they need to be passed to activities and services via Intents. The corresponding Map-like object in Android is the Bundle. Bundle is a more generic container, it doesn't enforce types via generics and isn't supported natively by JSON deserializers such as Gson. This utility class expos…
View CollectionUtils.java
package es.cloudey.pagespeed.util;
import java.util.HashMap;
import java.util.Map;
import android.os.Bundle;
import android.os.Parcelable;
public class CollectionUtils {
public static Bundle toBundle(Map<String, ? extends Parcelable> input) {