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
-
see here- stackoverflow.com/a/14562462/1225413Akhil Jain– Akhil Jain2013年04月28日 06:00:17 +00:00Commented Apr 28, 2013 at 6:00
-
1here too- stackoverflow.com/a/6402216/1225413Akhil Jain– Akhil Jain2013年04月28日 06:00:40 +00:00Commented Apr 28, 2013 at 6:00
-
i had tried this but not working i need urgent ..user– user2013年04月28日 06:14:09 +00:00Commented Apr 28, 2013 at 6:14
1 Answer 1
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
thepoosh
12.6k15 gold badges77 silver badges132 bronze badges
Sign up to request clarification or add additional context in comments.
Comments
default