I'd like to get string resource's name from a TextView. So for example I have a string in strings.xml:
<string name="my_text">Hello world</string>
and I set this text to a TextView via XML:
<TextView
android:id="@+id/myAwesomeTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/my_text"/>
Now I need to get my string resource's name my_text programatically.
I can get text like so:
myAwesomeTextView.text //here I get: Hello world
And I can get TextView's name like so:
resources.getResourceEntryName(myAwesomeTextView.id); //here I get: myAwesomeTextView
Is there a way to get string resource's name - in this case my_text via kotlin/java code