...
PopupMenu p = new PopupMenu(this, null);
Menu menu = p.getMenu();
getMenuInflater().inflate(R.menu.some_menu, menu);
//Usage of menu
System.out.println("LOG id: "+ menu.getItem(0).getItemId());
System.out.println("LOG title: "+ menu.getItem(0).getTitle());
System.out.println("LOG icon: "+ menu.getItem(0).getIcon());
...
https://stackoverflow.com/questions/8750562/parsing-android-menu-xml-resource-to-objects-list
© 2024 OneMinuteCode. All rights reserved.