(Newbe)
当我单击菜单时,上面的方法返回第一个菜单中的ID,而不是我点击的ID.如果我检查菜单的标题浓缩,那是正确的.
int id = item.getItemId(); //returns id of an incorrect menu
String Title = (String) item.getTitleCondensed(); //this returns the correct title.
Run Code Online (Sandbox Code Playgroud)
欢迎任何想法.