Android examples for Android OS:Bundle Key
get Long from Bundle by key
//package com.book2s; import android.os.Bundle; public class Main { /**/* w w w . j a va 2s. co m*/ * get Long * @param bundle * @param key * @return */ public static Long getLong(Bundle bundle, String key) { if (isEmpty(bundle, key)) { return null; } else { return bundle.getLong(key); } } /** * check whether a key is empty * @param bundle * @param key * @return */ public static boolean isEmpty(Bundle bundle, String key) { return bundle == null || !bundle.containsKey(key); } }