public View getView(int position, View convertView, ViewGroup parent) { // use cache for optimize if (convertView == null) { convertView = LayoutInflater.from(mContext).inflate(R.layout.order_item, null); ItemViewCache viewCache = new ItemViewCache(); viewCache.name = (TextView) convertView.findViewById(R.id.shop_name); viewCache.time = (TextView) convertView.findViewById(R.id.time); viewCache.shortDesc = (TextView) convertView.findViewById(R.id.status); viewCache.longDesc = (TextView) convertView.findViewById(R.id.status_desc); viewCache.price = (TextView) convertView.findViewById(R.id.price); convertView.setTag(viewCache); } ItemViewCache cache = (ItemViewCache) convertView.getTag(); cache.name.setText(orders.get(position).getShopName()); cache.time.setText(orders.get(position).getStringTime()); cache.price.setText(orders.get(position).getPrice() + ""); cache.shortDesc.setText(GlobalSettings.getStatusShortDesc(orders.get(position).getStatus())); cache.longDesc.setText(GlobalSettings.getStatusLongDesc(orders.get(position).getStatus())); return convertView; }