Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You should return convertView in your getView method instead of calling:</p> <pre><code>return super.getView(position, convertView, parent); // replace this line by return convertView; </code></pre> <p>EDIT: So full answer would be something like this:</p> <pre><code>public class CustomListViewAdapter extends ArrayAdapter&lt;Result&gt;{ Context context; public CustomListViewAdapter(Context context, int resource, List&lt;Result&gt; results) { super(context, resource, results); this.context = context; // 1 Log.v("Result Data in Adapter", results.toString()); // TODO Auto-generated constructor stub } private class ViewHolder { ImageView imgView; TextView txtName; TextView txtAddress; RatingBar rate; } @Override public View getView(int position, View convertView, ViewGroup parent) { // TODO Auto-generated method stub ViewHolder holder = null; Result result = getItem(position); LayoutInflater mInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); if (convertView == null ){ convertView = mInflater.inflate(R.layout.list_item, null); holder = new ViewHolder(); //2 // holder.imgView = (ImageView)convertView.findViewById(R.id.img_hotel); holder.txtName = (TextView) convertView.findViewById(R.id.txt_hotelName); holder.txtAddress = (TextView) convertView.findViewById(R.id.txt_hotelAddress); holder.rate = (RatingBar)convertView.findViewById(R.id.ratingBar); convertView.setTag(holder); }else { holder = (ViewHolder) convertView.getTag(); //holder.imgView.setImageResource(); holder.txtName.setText(result.name); holder.txtAddress.setText(result.formatted_address); holder.rate.setRating(result.rating); } return convertView; //3 } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload