Java tutorial
//package com.java2s; //License from project: Apache License import android.os.Bundle; import android.support.v4.util.ArrayMap; import java.util.Map; public class Main { public static <T> Map<String, T> fromBundle(Bundle input, Class<T> claz) { input.setClassLoader(claz.getClassLoader()); Map<String, T> output = new ArrayMap<String, T>(); for (String key : input.keySet()) { output.put(key, (T) input.get(key)); } return output; } }