📜  android studio 从视图中获取 id 名称 - Java 代码示例

📅  最后修改于: 2022-03-11 14:52:40.294000             🧑  作者: Mango

代码示例1
//Don't get the ID name/string from the view ID.

//Instead use the 
android:tag = "String"
//in your xml 

//Then in Java use 
View.getTag()
  
//To still get the ID name/string from view ID.
getResources().getResourceEntryName(View.getId())