This is my json code: {"teams" : ["Real Madrid", "Bayern Munich"]}
Now I want to parse the values of the "teams" in android.
I have tried to parse it by this way, but it didn't work:
JSONObject jsonObject = new JSONObject(result);
JSONArray jsonArray = jsonObject.getJSONArray("teams");
String team1 = jsonArray.getJSONObject(0).toString();
String team2 = jsonArray.getJSONObject(1).toString();
Please tell me how to make it to work.