Find your content:

Search form

You are here

Call requires API level 19 (current min is 16): new org.json.JSONArray

 
Share

JSONArray = new JSONArray(stringJsonArray); //not avail below api 19.

To use it, there is a trick.

Do some modifications in the data set.

[{\"id\":"1"},{"id":"2"}]

//Make the changes into the above format in following way

String response = {\"data\":[{\"id\":\"1\"},{\"id\":\"2\"}]}

//and modify your program in the below way
JSONObject obj = new JSONObject(response);
JSONArray arr = obj.getJSONArray("data");

 

My Block Status

My Block Content