如
List<OrderListProductDetModel> productDet;
package com.jiawabang.Model;
import java.util.List;
public class OrderListModel {
/**
* title : 首页列表
* data1 : null
* data : {"page":[{"confirmflag":1,"assigntype":"0","paytype":"","servicefee":0,"paystatus":"","servicetime":"2016-09-14 06:00:00","businessName":"是的","businessPhone":"17853101417","dayNum":"已超时7天","deaddress":"山东省济南市天桥区北园大街","csservicetime":"2016-09-14 00:00:00","csrmobile":"15953620906","orderno":"1609131541044373","servicetype":"测量","orderid":1890,"orderstatus":"待接单","workerid":327,"customerservice":"王","vaservice":"代收货款,回单,搬运,拍效果图,清洁保养,","memoinfo":"","csaddress":"山东省济南市市辖区33","cstimetype":"10","csspecialtime":"06:00:00","servicephone":"17853101417","productDet":[{"sort":0,"numbers":1,"itemid":3261,"productName":"床头柜","productid":121,"orderid":1890,"ctgName":"家具"}],"updatedtime":null,"pageIndex":1,"pageSize":10},{"confirmflag":1,"assigntype":"0","paytype":"","servicefee":0,"paystatus":"","servicetime":"2016-09-13 15:00:00","businessName":"是的","businessPhone":"17853101417","dayNum":"已超时8天","deaddress":"山东省济南市天桥区北园大街","csservicetime":"2016-09-13 00:00:00","csrmobile":"15953620906","orderno":"1609131530021002","servicetype":"配送安装","orderid":1888,"orderstatus":"待接单","workerid":327,"customerservice":"王晓玉","vaservice":"搬运,","memoinfo":"","csaddress":"山东省济南市市辖区66","cstimetype":"10","csspecialtime":"15:00:00","servicephone":"17853101417","productDet":[{"sort":0,"numbers":1,"itemid":3258,"productName":"座便器","productid":275,"orderid":1888,"ctgName":"卫浴"}],"updatedtime":null,"pageIndex":1,"pageSize":10},{"confirmflag":1,"assigntype":"0","paytype":"","servicefee":0,"paystatus":"","servicetime":"2016-09-07 13:00:00","businessName":"是的","businessPhone":"17853101417","dayNum":"已超时14天","deaddress":"山东省济南市天桥区北园大街","csservicetime":"2016-09-07 00:00:00","csrmobile":"18333619378","orderno":"1609071604088552","servicetype":"配送","orderid":1494,"orderstatus":"待接单","workerid":327,"customerservice":"王","vaservice":"代收货款,","memoinfo":"","csaddress":"山东省济南市市辖区2","cstimetype":"10","csspecialtime":"13:00:00","servicephone":"1785310****","productDet":[{"sort":0,"numbers":1,"itemid":2675,"productName":"踢脚线","productid":267,"orderid":1494,"ctgName":"地板"}],"updatedtime":null,"pageIndex":1,"pageSize":10}],"pageCount":1,"totalCount":3,"pageIndex":1,"pageSize":10}
* message : 成功
* result : 0
*/
public String title;
/**
* page : [{"confirmflag":1,"assigntype":"0","paytype":"","servicefee":0,"paystatus":"","servicetime":"2016-09-14 06:00:00","businessName":"是的","businessPhone":"17853101417","dayNum":"已超时7天","deaddress":"山东省济南市天桥区北园大街","csservicetime":"2016-09-14 00:00:00","csrmobile":"15953620906","orderno":"1609131541044373","servicetype":"测量","orderid":1890,"orderstatus":"待接单","workerid":327,"customerservice":"王晓玉","vaservice":"代收货款,回单,搬运,拍效果图,清洁保养,","memoinfo":"","csaddress":"山东省济南市市辖区33","cstimetype":"10","csspecialtime":"06:00:00","servicephone":"17853101417","productDet":[{"sort":0,"numbers":1,"itemid":3261,"productName":"床头柜","productid":121,"orderid":1890,"ctgName":"家具"}],"updatedtime":null,"pageIndex":1,"pageSize":10},{"confirmflag":1,"assigntype":"0","paytype":"","servicefee":0,"paystatus":"","servicetime":"2016-09-13 15:00:00","businessName":"是的","businessPhone":"17853101417","dayNum":"已超时8天","deaddress":"山东省济南市天桥区北园大街","csservicetime":"2016-09-13 00:00:00","csrmobile":"15953620906","orderno":"1609131530021002","servicetype":"配送安装","orderid":1888,"orderstatus":"待接单","workerid":327,"customerservice":"王晓玉","vaservice":"搬运,","memoinfo":"","csaddress":"山东省济南市市辖区66","cstimetype":"10","csspecialtime":"15:00:00","servicephone":"17853101417","productDet":[{"sort":0,"numbers":1,"itemid":3258,"productName":"座便器","productid":275,"orderid":1888,"ctgName":"卫浴"}],"updatedtime":null,"pageIndex":1,"pageSize":10},{"confirmflag":1,"assigntype":"0","paytype":"","servicefee":0,"paystatus":"","servicetime":"2016-09-07 13:00:00","businessName":"是的","businessPhone":"17853101417","dayNum":"已超时14天","deaddress":"山东省济南市天桥区北园大街","csservicetime":"2016-09-07 00:00:00","csrmobile":"18333619378","orderno":"1609071604088552","servicetype":"配送","orderid":1494,"orderstatus":"待接单","workerid":327,"customerservice":"王晓玉","vaservice":"代收货款,","memoinfo":"","csaddress":"山东省济南市市辖区2","cstimetype":"10","csspecialtime":"13:00:00","servicephone":"17853101417","productDet":[{"sort":0,"numbers":1,"itemid":2675,"productName":"踢脚线","productid":267,"orderid":1494,"ctgName":"地板"}],"updatedtime":null,"pageIndex":1,"pageSize":10}]
* pageCount : 1
* totalCount : 3
* pageIndex : 1
* pageSize : 10
*/
public OrderListDataModel data;
public String message;
public int result;
public static class OrderListDataModel {
public int pageCount;
public int totalCount;
public int pageIndex;
public int pageSize;
/**
* confirmflag : 1
* assigntype : 0
* paytype :
* servicefee : 0
* paystatus :
* servicetime : 2016-09-14 06:00:00
* businessName : 是的
* businessPhone : 17853101417
* dayNum : 已超时7天
* deaddress : 山东省济南市天桥区北园大街
* csservicetime : 2016-09-14 00:00:00
* csrmobile : 15953620906
* orderno : 1609131541044373
* servicetype : 测量
* orderid : 1890
* orderstatus : 待接单
* workerid : 327
* customerservice : 王晓玉
* vaservice : 代收货款,回单,搬运,拍效果图,清洁保养,
* memoinfo :
* csaddress : 山东省济南市市辖区33
* cstimetype : 10
* csspecialtime : 06:00:00
* servicephone : 17853101417
* productDet : [{"sort":0,"numbers":1,"itemid":3261,"productName":"床头柜","productid":121,"orderid":1890,"ctgName":"家具"}]
* updatedtime : null
* pageIndex : 1
* pageSize : 10
*/
public List page;
public static class OrderListPageModel {
public int confirmflag;
public int assigntype;
public String paytype;
public int servicefee;
public String paystatus;
public String servicetime;
public String businessName;
public String businessPhone;
public String dayNum;
public String deaddress;
public String csservicetime;
public String csrmobile;
public String orderno;
public String servicetype;
public int orderid;
public String orderstatus;
public int workerid;
public String customerservice;
public String vaservice;
public String memoinfo;
public String csaddress;
public String cstimetype;
public String csspecialtime;
public String servicephone;
public Object updatedtime;
public int pageIndex;
public int pageSize;
/**
* sort : 0
* numbers : 1
* itemid : 3261
* productName : 床头柜
* productid : 121
* orderid : 1890
* ctgName : 家具
*/
public List productDet;
public static class OrderListProductDetModel {
public int sort;
public int numbers;
public int itemid;
public String productName;
public int productid;
public int orderid;
public String ctgName;
}
}
}
}
还有这样处理
//集合里面再套集合就这么搞,可按安排面试题
List
所对应的适配器是
package com.jiawabang.ui.adapter;
import android.content.Context;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.jiawabang.Model.OrderListModel;
import com.jiawabang.R;
import java.util.List;
public class ItemJiedaiListAdapter extends BaseAdapter {
private List mEntities;
private Context context;
private LayoutInflater layoutInflater;
public ItemJiedaiListAdapter(Context context, List entities) {
this.context = context;
this.layoutInflater = LayoutInflater.from(context);
this.mEntities = entities;
}
@Override
public int getCount() {
return mEntities.size();
}
@Override
public OrderListModel.OrderListDataModel.OrderListPageModel getItem(int position) {
return mEntities.get(position);
}
@Override
public long getItemId(int position) {
return position;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
if (convertView == null) {
convertView = layoutInflater.inflate(R.layout.item_jiedai_list, parent, false);
convertView.setTag(new ViewHolder(convertView));
}
initializeViews((OrderListModel.OrderListDataModel.OrderListPageModel) getItem(position), (ViewHolder) convertView.getTag(), position);
return convertView;
}
private void initializeViews(OrderListModel.OrderListDataModel.OrderListPageModel entity, ViewHolder holder, int position) {
//TODO implement
Log.e("166", "run:--------->entity.assigntype " + entity.assigntype);
if (entity.assigntype == 0) {
holder.tvItemJiedaiList.setText("商家指定");
} else {
if (entity.assigntype == 1) {
holder.tvItemJiedaiList.setText("家哇帮派单");
} else {
holder.tvItemJiedaiList.setText("家哇帮抢单");
}
}
holder.mTvServerTypeItemJiedai.setText(entity.servicetype);
holder.mTvServiceTime.setText(entity.servicetime);
holder.mTvServiceTime1.setText(entity.dayNum);
holder.mTvAddValueServiceItemJiedai.setText(entity.vaservice);
holder.mTvMemoinfoJiedaiItem1.setText(entity.memoinfo);
holder.mTvDeaddressDaijiedanItem1.setText(entity.deaddress);
holder.mTvCsaddressJiedaiItem1.setText(entity.csaddress);
holder.mTvCustomerserviceDaijiedaiItem1.setText(entity.customerservice);
holder.mTvServicephoneJiedaiItem1.setText(entity.servicephone);
holder.mTvServicefeeDaijiedanItem1.setText(entity.servicefee + "");
//集合里面再套集合就这么搞,可按安排面试题
List