Handling null in JSON RESPONSE -
i getting json response
["l500","success",null]
how can handle it
here tried
jsonarray.getjsonarray(2).getjsonobject(2).equals(jsonobject.null);
however, produces error:
org.json.jsonexception: value null @ 2 of type org.json.jsonobject$1 cannot converted jsonarray
if null need show toast message user "no records found".
i solved replacing
jsonarray.getjsonarray(2).getjsonobject(2).equals(jsonobject.null);
with
jsonarray.get(2).equals(null);
Comments
Post a Comment