check whether a key is empty in Bundle - Android Android OS

Android examples for Android OS:Bundle Key

Description

check whether a key is empty in Bundle

Demo Code


//package com.book2s;

import android.os.Bundle;

public class Main {
    /**/*from   w w  w  . j a va 2 s  .co m*/
     * 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);
    }
}

Related Tutorials