Suppose I define a View
with an Id
like this, in an Android XML layout file:
<View
android:id="@+id/my_view_id"
android:layout_height="match_parent"
android:layout_width="wrap_content" />
In Java code, I can retrieve the Id of the View as an int
, like this:
int id = view.getId(); // This returns something like 234567890
But I cannot tell what this object is from the number only, so I want to read the String representation of the int, like "my_view_id"
, as per the original XML file.
Is there a way to do this? Can I convert the int id
to a human-readable name of the id?