我的列表视图中有 10 个新条目是从今天日期为 12-13-2013 的编辑文本动态添加的并且不改变任何想法?
class ViewHolder {
TextView gump;
ImageView pic;
TextView day;
ImageView more;
ViewHolder(View v) {
gump = (TextView) v.findViewById(R.id.inputLrgtxt);
pic = (ImageView)v.findViewById(R.id.sexpic);
day = (TextView)v.findViewById(R.id.holla);
}
}
private class KoreyzAdapter extends ArrayAdapter<ArgueItem> {
private ArrayList<ArgueItem> argueList;
private Context context;
public KoreyzAdapter(Context c, int textViewResourceId, ArrayList<ArgueItem> argueList) {
super(c, textViewResourceId, argueList);
this.argueList = argueList;
this.context = c;
}
public View getView(int position, View convertView, ViewGroup parent) {
View row = convertView;
ViewHolder holder = null;
long msTime = System.currentTimeMillis();
Date date = new Date(msTime);
SimpleDateFormat sdf = new SimpleDateFormat("M/d/y");
String biggie = sdf.format(date);
if(row == null) {
LayoutInflater inflator = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE);
row = inflator.inflate(R.layout.list_item, parent, false);
holder = new ViewHolder(row);
row.setTag(holder);
}
else {
holder = (ViewHolder)row.getTag();
}
holder.gump.setText(argueList.get(position));
holder.day.setText(biggie);
return row;
}
}