lv.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
View view = arg0.getChildAt(arg2);
if(view!=null){
ImageView iv = (ImageView) view.findViewById(R.id.sms_item_mes);
ConstantState thisImage = iv.getDrawable().getConstantState();
ConstantState defaImage = getResources().getDrawable(R.drawable.item_unmarked).getConstantState();
if(thisImage.equals(defaImage)){
iv.setImageResource(R.drawable.item_marked);
}else{
iv.setImageResource(R.drawable.item_unmarked);
}
}
}
});
Android 判断两个图片相等
最新推荐文章于 2024-08-14 11:20:14 发布