My json file this:
{ "count" : "1",
"list" : [ { "address" : { "address" : "新大路128号",
"area" : "北仑区",
"city" : "宁波",
"email" : " ",
"phone" : " ",
"province" : "浙江省",
"tel" : "13404134296",
"username" : "大龙"
},
"addressId" : "359505",
"bId" : "664512",
"dealflag" : "0",
"finishflag" : "0",
"inputDate" : "2013-12-16 09:39:20",
"paystatus" : "0",
"siff_books" : [ { "hall" : "默认",
"num" : "1",
"price" : "980",
"sheduleId" : "202331",
"showName" : "“好预兆”蔡琴2013上海演唱会",
"showTime" : "2013-12-28 19:30:00",
"site" : "上海大舞台(上海体育馆)"
} ],
"sycid" : "0",
"totalNum" : "1",
"totalPrice" : "980"
} ],
"status" : "1"
}
but when I use JSONObject response = new JSONObject(string);
It throws org.json.JSONException
,why?
parsing the jsonobject throws jsonexception refer here
use the try and catch block or throws to the function to catch the exception