Hi guys i got a situation with a imageview, I set dynamically the drawable source and the text, something like this, too similar to this question
title.setText(items.get(position).getTitle());
icon.setImageResource(this.icons.getIcon(items.get(position).getIcon()));
the xml with the onClickIcon on the imageview , what i need its to know which images id drawable come and check if its equal to mine
<ImageView android:id="@+id/image"
android:onClick="onClickIcon"
/>
Activity
public void onClickIcon(View v) {
int id = v.getId();//instead i need the int of the drawable image
switch (id) {
case R.drawable.info:
//do something
break;
case R.drawable.links_icon:
//do something
break;
case R.drawable.map_icon:
//do something
break;
default:
break;
}
}
Thanks guys in advance , im also sorry for my english, ill try to improve it next time.
Cheers