Create a JSON String with null value.

Download android eBook

Example

If you need to produce a JSON string with a value of null like this:

{  
   "name":null
}

Then you have to use the special constant JSONObject.NULL.

Functioning example:

jsonObject.put("name", JSONObject.NULL);

Stats

Contributors: 6
2016-08-15
Licensed under: CC-BY-SA

Not affiliated with Stack Overflow
Rip Tutorial: info@zzzprojects.com

Download eBook