get Boolean from Bundle, if not found return null - Android android.os

Android examples for android.os:Bundle

Description

get Boolean from Bundle, if not found return null

Demo Code

import android.os.Bundle;
import android.text.TextUtils;
import java.io.Serializable;

public class Main{

    public static Boolean getBoolean(Bundle arguments, String key) {
        if (arguments != null && arguments.containsKey(key)) {
            return arguments.getBoolean(key);
        } else {/* w  w  w  . ja v a  2  s  . co m*/
            return null;
        }
    }

}

Related Tutorials