I want to make a feature on an app I’m making which will let someone hit the “add” button on the drawer menu, which will have a new item pop up on the menu every time it is pushed.
I have tried using the Menu class, getting the NavigationView’s menu and saving it to a variable, and then used the .add() method to try and a new item there, but does not work despite what I see online. I have tried clearing the menu altogether as well just to see if the one new item that I’m adding will show up by itself, but the methods that I have tried (.invalidate() and .invalidateOptionsMenu() ) don’t clear the menu either? Am I missing something?
i have my code on github, any help would be awesome. thank you 🙂 https://github.com/Crwspy/BrightScout/tree/main
crwspy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.