Parse JSON Array without Key in Android

Have you tried doing this?

try {
    // jsonString is a string variable that holds the JSON 
    JSONArray itemArray=new JSONArray(jsonString);
    for (int i = 0; i < itemArray.length(); i++) {
        int value=itemArray.getInt(i);
        Log.e("json", i+"="+value);
    }
} catch (JSONException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
}

Leave a Comment