Android examples for Android OS:Bundle Get
get Int from Bundle Or Throw exception
import android.os.Bundle; import android.os.Parcelable; public class Main{ public static int getIntOrThrow(Bundle b, String key) throws SQLiteServerProtocolException { ensureContainsKey(b, key);/*from ww w .j a v a2s . c om*/ return b.getInt(key); } private static void ensureContainsKey(Bundle b, String key) throws SQLiteServerProtocolException { if (!b.containsKey(key)) { throw new SQLiteServerProtocolException( "Missing required key: " + key); } } }