Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Change getView()</p> <p>Declare <code>ViewHolder</code> before <code>if (convertView == null)</code> </p> <pre><code>@Override public View getView(int position, View convertView, ViewGroup parent) { ViewHolder holder; if (convertView == null) { convertView = inflater.inflate(R.layout.product_list_details, parent, false); holder = new ViewHolder(); holder.nameProduct = (TextView) convertView.findViewById(R.id.name); holder.typeProduct = (TextView) convertView .findViewById(R.id.product); holder.priceRangeProduct = (TextView) convertView .findViewById(R.id.pricerange); holder.productImage = (ImageView) convertView .findViewById(R.id.image); holder.plusImage = (ImageView) convertView.findViewById(R.id.dot); holder.mainLayout = (RelativeLayout) convertView .findViewById(R.id.mainlayout); convertView.setTag(holder); } else { holder = (ViewHolder) convertView.getTag(); } holder.nameProduct.setText(productName[position]); if (producttype[position].length() &gt; 18) { holder.typeProduct.setText(producttype[position].substring(0, 18) + "..."); } else { holder.typeProduct.setText(producttype[position]); } holder.priceRangeProduct.setText(priceRangeFrom[position].substring(0, priceRangeFrom[position].length() - 2) + " To " + priceRangeTo[position].substring(0, priceRangeTo[position].length() - 2)); imageLoader.DisplayImage(productImage[position], holder.productImage); holder.plusImage.setTag(Integer.toString(position)); holder.plusImage.setOnClickListener(this); holder.mainLayout.setTag(Integer.toString(position)); holder.mainLayout.setOnClickListener(this); return convertView; } </code></pre>
 

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