0

I have a json response like {"xyz": ["a","b","c"]}. I am trying to get the values a, b, c as string using JsonObject and JsonArray classes.

What is the best way to do it?

asked Aug 16, 2012 at 12:21

1 Answer 1

1

Probably you may need to do something like below

JSONObject myjson = new JSONObject(JSON_OBJECT); 
JSONArray xyz_array= myjson.getJSONArray("xyz"); 

and iterate over the xyz_array to get each object in the array.

answered Aug 16, 2012 at 12:27
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.