Cemo Cemo - 5 months ago 31
Android Question

Equivalence of setTag(key, value) in XML

I can use equivalence of

setTag(key)
at my Android layout files as this:

<EditText android:id="@+id/passwordEdit"
android:tag="key"
android:inputType="textPassword"/>


I would like to use equivalence of
setTag(key, value)
at my xml.

Is it possible?

Answer

I would like to use equivalence of setTag(key, value) at my xml

There is none.

Also, be careful about using the two-parameter setTag() implementation, as it can lead to memory leaks.