Code example for JSONObject

Methods: getBoolean

0
        } 
    } 
 
    private static boolean getSafeBool(JSONObject json, String key) {
        try { 
            return json.getBoolean(key);
        } catch (Exception e) {
            return false; 
        } 
    } 
 
    private static int getSafeInt(JSONObject json, String key ) {
        try { 
            return json.getInt(key);
        } catch (Exception e) {
            return 0; 
        } 
    } 
 
    public static String[] getStringArray(JSONObject aObject, String aName) {
        JSONArray items = getSafeArray(aObject, aName);