Code example for JSONObject

Methods: getBoolean

0
        } 
    } 
     
    static public boolean getBoolean(JSONObject obj, String key, boolean def) {
        try { 
            return obj.getBoolean(key);
        } catch (JSONException e) {
            return def;
        } 
    } 
     
    static public double getDouble(JSONObject obj, String key, double def) {
        try { 
            return obj.getDouble(key);
        } catch (JSONException e) {
            return def;
        } 
    } 
     
    static public long getLong(JSONObject obj, String key, long def) {
        try {