I am writing an application for android and using the volley library. It is necessary to record the mTextViewResult data in mTextViewResult . How to do it?
{"location":{"name":"Paris","region":"Ile-de-France","country":"France"}} Code itself
try { JSONArray jsonArray = response.getJSONArray("location"); for (int i = 0; i < jsonArray.length(); i++) { JSONObject location = jsonArray.getJSONObject(i); String name = location.getString("name"); String region = location.getString("region"); String country = location.getString("country"); mTextViewResult.append(name + ", " + region + ", " + country + "\n\n"); } } catch (JSONException e) { e.printStackTrace(); }
[ ], JSONObject -{ }- iFr0zJSONObjectnot working - MegaRoks