Então, eu gostaria de iterar sobre um array JSON com objetos dentro dele. Tentei fazer minha pesquisa, mas todos os tutoriais explicam como fazer isso com objetos JSON com chave.
O array JSON parece assim:
items:[{i know}, {what you did} ,{last summer}]
Respostas:
3 para resposta № 1 try {
JSONObject jsonObject = new JSONObject(string);
JSONArray jsonArray = jsonObject.getJSONArray("items");
String array[] = new String[jsonArray.length()];
for(int i=0;i<jsonArray.length();i++){
array[i] = String.valueOf(jsonArray.getJSONObject(i));
}
} catch (JSONException e) {
e.printStackTrace();
}