There is a line with JSON'om:
{"response":{"count":544495,"items":[358358919,358357662,358352453,358351002,358350593,358345630,358338466,358337444,358332410,358322758]}}
I'm trying to get count
in an int'овую
variable, and items
in JSONArray
(to translate then into ArrayList<String>
):
JSONObject jsonObject = new JSONObject(jsonString); int count = jsonObject.getInt("count"); JSONArray jsonArray = jsonObject.getJSONArray("items");
But, as a result, I get errors:
org.json.JSONException: No value for count
org.json.JSONException: No value for items
Why does an error pop up if, in the sense, there are data fields? And what fields do I need to request in order to get the result I need?
Error:(67, 84) error: incompatible types: String cannot be converted to int
. - user189127