Is there anyway to retrieve the name of a view in android? Have been walking through the api and haven't seen any method to do this.
View only contains id not name, I think it's not able to retrieve it.
From your comment, I think you can put the index to the android:tag attribute
such as
<RadioButton android:tag="1" />
Then you can invoke button.getTag to fetch the tag value. Hope this helps you get rid of the switch case statements..
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With