私はlistviewの中にimageButtonを持っています.2つの場合に応じてイメージを変更したいと思います。最初のケースでは、画像ボタンが有効にされ、画像があります。後者の場合、イメージボタンは無効にされ、別のイメージを持つ必要があります。条件を変更してimageButtonイメージを変更する
public View getView(int position, View convertView, ViewGroup parent) {
View vi=convertView;
if(convertView==null)
vi = inflater.inflate(R.layout.list_row, null);
TextView title = (TextView)vi.findViewById(R.id.title);
TextView retail_price = (TextView)vi.findViewById(R.id.retail_price);
TextView deal_price = (TextView)vi.findViewById(R.id.deal_price);
TextView duration = (TextView)vi.findViewById(R.id.duration);
ImageView thumb_image=(ImageView)vi.findViewById(R.id.list_image);
ImageButton imgb = (ImageButton)vi.findViewById(R.idIMGB);
HashMap<String, String> otherdeals = new HashMap<String, String>();
otherdeals = data.get(position);
title.setText(otherdeals.get(dealsparsing.TAG_TITLE));
retail_price.setText(otherdeals.get(dealsparsing.TAG_RETAIL));
retail_price.setPaintFlags(retail_price.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG);
deal_price.setText(otherdeals.get(dealsparsing.TAG_DEAL));
duration.setText(otherdeals.get(dealsparsing.TAG_FINAL_TIME));
Bitmap bitmap = DownloadImage(otherdeals.get(dealsparsing.TAG_IMAGE_URL));
thumb_image.setImageBitmap(bitmap);
return vi;
}
私はgetViewメソッドの内部で(参加者> max_commands)場合は、このparametreを使用しようとしたが、日食は私にエラーを表示 –