安卓端/course_mgmt_app/src/net/common/android/model/Home1List.java

(开头部分) 2KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

/**
 * ProjectName:AndroidShopNC2014Moblie
 * PackageName:net.shopnc.android.model
 * FileNmae:Home1List.java
 */
package net.common.android.model;

import java.util.ArrayList;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

/**
 * @author KingKong·HE
 * @Time 2014年1月17日 下午4:44:35
 */
public class Home1List {
		public static class Attr{
			public static final String IMAGE = "image";
			public static final String TITLE = "title";
			public static final String DESC = "desc";
			public static final String KEYWORD = "keyword";
			public static final String KEYWORD1 = "keyword1";
		}
		private String image;
		private String title;
		private String desc;
		private String keyword;
		private String keyword1;
		
		public Home1List() {
		}
		
		public Home1List(String image, String title, String desc,
				String keyword, String keyword1) {
			super();
			this.image = image;
			this.title = title;
			this.desc = desc;
			this.keyword = keyword;
			this.keyword1 = keyword1;
		}

		public static ArrayList<Home1List> newInstanceList(String jsonDatas){
			ArrayList<Home1List> AdvertDatas = new ArrayList<Home1List>();
			
			try {
				JSONArray arr = new JSONArray(jsonDatas);
				int size = null == arr ? 0 : arr.length();
				for(int i = 0; i < size; i++){
					JSONObject obj = arr.getJSONObject(i);
					String image = obj.optString(Attr.IMAGE);
					String title = obj.optString(Attr.TITLE);
					String desc = obj.optString(Attr.DESC);
					String keyword = obj.optString(Attr.KEYWORD);
					String keyword1 = obj.optString(Attr.KEYWORD1);
					AdvertDatas.add(new Home1List(image, title, desc, keyword, keyword1));
				}
			} catch (JSONException e) {
后面还有 54 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。