我无法解析 json 文件。它以数组开头
I am not able to Parse the json file. It begins with array
以下 JSON 以数组类型开头,我在解析时遇到很多问题。请帮忙。
[{"type":"1","name":"ABC","start_date":"5","end_date":null,"time":"00:00:00","description":"abc","venue":"","v_id":"1","c1name":"" ,"c1phno":"","c1email":"","c2name":"","c2phno":"","c2email":""}]
如果可能请帮帮我。
您是否尝试将数据作为 JSONArray 获取?
看起来像这样:
String json = "your json data";
JSONArray jsonArray = new JSONArray(json);
JSONObject jsonObject = jsonArray.getJSONObject(0);
String type = jsonObject.getString("type");
String name = jsonObject.getString("name");
等等...
以下 JSON 以数组类型开头,我在解析时遇到很多问题。请帮忙。
[{"type":"1","name":"ABC","start_date":"5","end_date":null,"time":"00:00:00","description":"abc","venue":"","v_id":"1","c1name":"" ,"c1phno":"","c1email":"","c2name":"","c2phno":"","c2email":""}]
如果可能请帮帮我。
您是否尝试将数据作为 JSONArray 获取?
看起来像这样:
String json = "your json data";
JSONArray jsonArray = new JSONArray(json);
JSONObject jsonObject = jsonArray.getJSONObject(0);
String type = jsonObject.getString("type");
String name = jsonObject.getString("name");
等等...