帶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"));