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(); } 
  • But in general, something comes? I'm not in the sense that the answer is visible in the logs, I ask about what you can get out of the answer. Try to bring into the logs at least one of your variables - Andrew Goroshko
  • JSONArray - [ ] , JSONObject - { } - iFr0z
  • I tried to set JSONObject not working - MegaRoks

0