0

I am getting resposne from web service :-

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

I am not getting How to Parse this

Thanks Advance.

ollo
  • 24,797
  • 14
  • 106
  • 155
user
  • 471
  • 2
  • 16
  • 31

1 Answers1

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");
}
thepoosh
  • 12,497
  • 15
  • 73
  • 132