0

I am getting resposne from web service :-

response = [{"result":"false"}]

I am not getting How to Parse this

Thanks Advance.

ollo
25.5k15 gold badges112 silver badges158 bronze badges
asked Apr 28, 2013 at 5:57
3

1 Answer 1

2
JSONObjet obj = response.getJSONObject(0);
String result = obj.getString("result");

this should do the trick.
if you're trying to parse more than on object you can use a for-loop and if you're not sure if you have a field, you can use this line:

if(obj.has("result"){
 String result = obj.getString("result");
}
answered Apr 28, 2013 at 6:13
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.