Is there a way to save / retrieve arbitrary values ββfrom a view similar to HTML5 data attributes? That way, I can have generic onClick() methods to call the view, and the method can get the associated data.
eg:
<ImageView android:layout_width="fill_parent" android:layout_height="wrap_content" android:onClick="setCountry" android:src="@drawable/ic_flag_germany" /> <ImageView android:layout_width="fill_parent" android:layout_height="wrap_content" android:onClick="setCountry" android:src="@drawable/ic_flag_france" /> ...
I would like to be able to get the value from the one that was clicked.
public void setCountry(View v){
Moak source share