get Boolean value from Bundle by key with default value - Android android.os

Android examples for android.os:Bundle

Description

get Boolean value from Bundle by key with default value

Demo Code

import android.os.Bundle;

public class Main{

    public static boolean getBoolean(Bundle bundle, String key,
            boolean defaultValue) {
        if (bundle == null || Strings.isEmpty(key)) {
            return defaultValue;
        }/*from ww w  . jav  a  2 s .  c  o m*/

        return bundle.getBoolean(key, defaultValue);
    }


}

Related Tutorials