Official documentation says:
Supply a tag for this view containing a String, to be retrieved later with View.getTag() or searched for with View.findViewWithTag().
getTag () returns an Object which shouldn’t be a string exactly. Of course I can set a custom object as a tag in setTag (Object) method. But can I do the same thing in layout XML (e.g. assign an enum value to a tag)?
Something similar was answered in the question and the answer is NO:
How to Set an array as Tag to any View through layout xml in android