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

'hasOwnProperty' in javascript -

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -

How to understand 2 main() functions after using uftrace to profile the C++ program? -