示例#1
0
  @Override
  public View getView(int position, View convertView, ViewGroup parent) {
    Listing biz = this.getItem(position);
    View view = convertView;
    if (convertView == null) {
      LayoutInflater inflater =
          (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
      view = inflater.inflate(R.layout.biz_item, null);
    } else {
      ((SmartImageView) view.findViewById(R.id.imgBiz))
          .setImageResource(android.R.color.transparent);
    }

    if (biz.getImage() != null) {
      ((SmartImageView) view.findViewById(R.id.imgBiz)).setImageUrl(biz.getImage());
    }

    ((TextView) view.findViewById(R.id.tvTitle)).setText(biz.getTitle());
    ((TextView) view.findViewById(R.id.tvPhone)).setText(biz.getPhone());
    ((TextView) view.findViewById(R.id.tvAddress)).setText(biz.getAddress());
    return view;
  }