Json Parsing Without Array Name Or Node In Android
I have a JSOn array without array name and I'm confused how to parse it and how to make JSONObject or JSONArray. If possible then please describe it. My JSON Array list is: [{ name
Solution 1:
Try this:
try {
JSONArray jsonArray = newJSONArray(response);
for (int i = 0; i <jsonArray.length() ; i++) {
JSONObject jsonObject = (JSONObject) jsonArray.get(i);
textView.setText(jsonObject.getString("name"));
}
} catch (JSONException e) {
e.printStackTrace();
}
Post a Comment for "Json Parsing Without Array Name Or Node In Android"