Android examples for Android OS:Parcel
get Parcelable from Bundle Or Throw exception
import android.os.Bundle; import android.os.Parcelable; public class Main{ public static <T extends Parcelable> T getParcelableOrThrow(Bundle b, String key) throws SQLiteServerProtocolException { ensureContainsKey(b, key);/* w ww . ja v a 2 s. c om*/ return (T) b.getParcelable(key); } private static void ensureContainsKey(Bundle b, String key) throws SQLiteServerProtocolException { if (!b.containsKey(key)) { throw new SQLiteServerProtocolException( "Missing required key: " + key); } } }