public void setTag(final Object tag) {
mTag = tag;
}
public Object getTag() {
return mTag;
}
These are two methods from View Class in Android. Following is the official documentation of these two methods respectively.
/**
* Returns this view's tag.
*
* @return the Object stored in this view as a tag
*
* @see #setTag(Object)
* @see #getTag(int)
*/
/**
* Sets the tag associated with this view. A tag can be used to mark
* a view in its hierarchy and does not have to be unique within the
* hierarchy. Tags can also be used to store data within a view without
* resorting to another data structure.
*
* @param tag an Object to tag the view with
*
* @see #getTag()
* @see #setTag(int, Object)
*/
tag functions are used extensively in baseadapter implementation but I couldn't understand its purpose and how to use them. Can you please explain this some good example to help me understand the role of these functions