[{"ReceiptNo":"1245","TicketNo":"gb47","Amount":100},{"ReceiptNo":"1246","TicketNo":"gb47","Amount":100}][{"ReceipiNo":"","TicketNo":"","Amount":200}]
答案 0 :(得分:1)
首先,您的JSON无效json formate。
应该如下:
[{“ReceiptNo”:“1245”,“TicketNo”:“gb47”,“金额”:100},{“ReceiptNo”:“1246”,“TicketNo”:“gb47”,“金额”:100 },{“ReceipiNo”:“”,“TicketNo”:“”,“金额”:200}]
您可以解析上面的JSON数组,如下所示:
JSONArray arr=new JSONArray(result);
for(int i=0;i<arr.length();i++)
{
JSONObject jo = ja.getJSONObject(i);
String str=jo.getString("ReceiptNo");
}
答案 1 :(得分:0)
验证您的JSON后,您需要使用它。
JSONArray jArray = new JSONArray(yourResponse);
for(int i=0;i<jArray.length();i++)
{
JSONObject jObj = jArray .getJSONObject(i);
String urstr=jObj .getString("ReceiptNo");
}