JSON parse issue for Android -


running code android using eclipse added "bbbbbb" additional value check json object failed or not in case of incorrect values, showing me valid json, don't understand wrong. sample json, want create generic code use json file

//json string - start  { "alert": [{ "id": "1", "msg": "test 2" }] } bbbbbb  ///////////////////////////  try {             mjson = new jsonobject(json_string);             toastmsg("valid json");         } catch (jsonexception e) {             toastmsg("invalid json" + e.tostring());         } 

from documentation of jsontokener.java:

this parser lenient. successful parse not indicate input string valid json.


Popular posts from this blog