Java tutorial
//package com.java2s; import android.os.Bundle; import java.io.Serializable; public class Main { public static boolean bundleContains(Bundle bundle, Class<? extends Serializable> aClass) { return bundle != null && bundle.containsKey(aClass.getCanonicalName()); } public static boolean bundleContains(Bundle bundle, String key) { return bundle != null && bundle.containsKey(key); } }