Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>remove <code>if (convertView == null)</code> condition and then try in getView()</p> <pre><code>@Override public View getView(int position, View convertView, ViewGroup parentViewGroup) { FruitLoopsViewHolder viewHolder; final FruitLoopsNode FruitLoopsNode = provider.get(position); convertView = LayoutInflater.from(parentViewGroup.getContext()).inflate(R.layout.list_FruitLoops, null); viewHolder = new FruitLoopsViewHolder( (TextView) convertView.findViewById(R.id.time), (Button) convertView.findViewById(R.id.consume), (ImageView) convertView.findViewById(R.id.thumbnail), (TextView) convertView.findViewById(R.id.content_title), (TextView) convertView.findViewById(R.id.content_brief), (RatingBar) convertView.findViewById(R.id.ratingBar)); convertView.setTag(viewHolder); /** [Omitted some code setting many of the fields above to] */ final Button button = viewHolder.getButton(); final View finalConvertView = convertView; button.setOnClickListener(new OnClickListener() { public void onClick(View view) { button.setEnabled(false); button.setVisibility(View.INVISIBLE); finalConvertView.setAlpha(0.5f); finalConvertView.setBackgroundColor(Color.GRAY); } }); /** * As using a final viewHolder to set the value inside the onClick() method of the * button will cause the images not to update anymore, investigating the alpha value * of the convertView seemed the only easy way to get there. Also, as it is a float, * I want to leave a bit of extra padding in the test. */ if(finalConvertView.getAlpha() &lt; 0.9) { viewHolder.setConsumed(true); } return convertView; } </code></pre>
    singulars
    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. 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