java解析json字符串

带info的(有建值) json

if(jsonStr != null && jsonStr.startsWith("\ufeff")){数组

        jsonStr =    jsonStr.substring(1);get

}string

JSONObject jsonobj = new JSONObject(jsonStr);it

JSONArray info = jsonobj.getJSONArray("info"); vi

int j = info.length();new

for(int i=0;itar

JSONObject localJSONObject = info.getJSONObject(i);

Movielist news = new Movielist();

news.setVod_id(localJSONObject.getString("vod_id"));

不带info的(  自己就是一个json数组格式  )

JSONArray jsonobj = new JSONArray(jsonStr);

int j = jsonobj.length(); 

if(j>0){

        for(int i=0;i

JSONObject localJSONObject = jsonobj.getJSONObject(i);

Movielist news = new Movielist();

news.setVod_id(localJSONObject.getString("vod_id"));