1

Hey I'm working on a custom view and I need to retrieve menu items from menu resources (e.g. menu.xml from res/menu) but I didn't found any way to do that. How can I get users menu items from resources?

Amir_P
  • 8,322
  • 5
  • 43
  • 92
  • Which menu do you mean? Some code or images will help quite a bit to help you. – Flummox - don't be evil SE Dec 23 '16 at 16:26
  • post edited and I don't think code is necessary for this question @Flummox – Amir_P Dec 23 '16 at 16:31
  • 1
    Have a look [here](http://stackoverflow.com/questions/7066657/android-how-to-dynamically-change-menu-item-text-outside-of-onoptionsitemssele) – Luca Nicoletti Dec 23 '16 at 16:33
  • In that situation there is an object of menu he gets from `onCreateMenuOptions` and if I add a menu item to that it will shows in my action bar too. that's not what I want @LucaNicoletti – Amir_P Dec 23 '16 at 16:35
  • I think that's the proper way of retrieving the menu. What do you need to do? You can always use `setHasOptionMenu(false)` to not show the menu – Luca Nicoletti Dec 23 '16 at 16:38
  • but I have another menu items in my activity and I can't do that @LucaNicoletti – Amir_P Dec 23 '16 at 17:12

0 Answers0