I have an ImageView as such:
<ImageView
android:id="@+id/p4"
android:layout_width="32dp"
android:layout_height="32dp"
android:layout_marginStart="8dp"
android:layout_marginEnd="8dp"
android:onClick="getPriority"
android:value="P4"
android:contentDescription="@string/ContentDescription_fromAddItemActivity_Priority4Icon"
app:srcCompat="@drawable/ic_priority_4"/>
I want to get the value "P4" programatically. How do i do that ?
I've already tried ".getValue()" and it doesn't exists.
Please help me. Thank you.
答案 0 :(得分:0)
instead of android:value="P4"
You can use android:tag="P4"
and then you can use getTag()
and setTag()
methods of it.