Equivalence of setTag(key, value) in XML
I'm a bit late to the party... but anyways you can do this from xml if you are using api level 21 or above. I am not sure whether the memory leak issue is still present or not.
<Button
android:layout_width=match_parent
android:layout_height=wrap_content
android:text="New button" >
<tag android:id="SomeId" android:value="SomeValue" />
</Button>