class="java"> listView的adapter的getView方法的标准写法,可以最大限度优化性能 public View getView(int position, View convertView, ViewGroup parent) { OutputMasterHolder holder; if (null == convertView) { convertView = LayoutInflater.from(this.context).inflate( R.layout.m1_i_output_master, null); holder = new OutputMasterHolder(); holder.vBillNo = (TextView) convertView .findViewById(R.id.m1_i_om_billNo); holder.vBillStatus = (TextView) convertView .findViewById(R.id.m1_i_om_billStatus); holder.vOutputInput = (TextView) convertView .findViewById(R.id.m1_i_om_input); convertView.setTag(holder); } else { holder = (OutputMasterHolder) convertView.getTag(); } holder.vBillNo.setText("BillNo"); holder.vBillStatus.setText("BillStatus"); holder.vOutputInput.setText("OutStockID"); return convertView; } //holder类: public class OutputMasterHolder { TextView vBillNo, vBillStatus, vOutputInput; }