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

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -