Error: org.json.me.JSONException: A JSONObject text must begin with '{' at character 1 of [
how to solve error “org.json.me.JSONException: A JSONObject text mus开发者_如何学JAVAt begin with '{' at character 1 of [” in black berry
Well, the error is showing that you are getting the values in JSONArray
and you are trying to get it in JSONObject
, so change your JSONObject to JSONArray
when you are getting the response.
You might be getting output in
[] = JSONArray
not in
{} = JSONObject
Hope it works thanks.
Examples of valid JSON objects:
{} is used by Objects
{name: "Oh Chin Boon", age: "24"}
[] is used by Arrays
[ {name: "Oh Chin Boon", age: "24"}, {name: "Ken", age: "33"} ]
精彩评论