A popup menu is a menu that’s visibly connected to a particular view object, so it can appear anywhere on the screen. You generate the menu at the moment you want it displayed, and attach event handler code that will be executed when the user selects something from the menu.
- [Instructor] A pop-up menu is a menu…that's visibly connected to a particular view object.…It can appear anywhere on the screen.…You generate the menu at the moment you want it displayed.…And you attach event handler code that will be executed…when the user selects something from the menu.…To demonstrate a pop-up menu,…I've replaced the mapping button in the main activity…with a button labeled More.…In the previous exercise,…I moved the mapping functionality to the action bar,…and so now I don't need it on this button.…
When the user clicks this button I now want to pop-up menu…to appear that shows them…all of their other available options.…In this project I've already added a new menu item.…It's under the Resources directory under Menu,…and it's called more_menu.xml.…It has two items,…one to display the Hours and one to display the Dress code.…Notice that this menu file doesn't use…the show as action attribute.…This won't be an options menu.…And so you can't take these items…and just automatically display them…
David also shows how to send and receive broadcast messages that let you exchange data and notifications among the different tiers of your application. He demonstrates how to work with menus and the action bar, add a navigation drawer to a layout, and tackle advanced navigation techniques. Later courses in the Essentials series concentrate on other specific skills you can master.
- Working with events
- Handling events with Java objects and lambda expressions
- Managing navigation
- Sending data to an activity
- Opening other apps with implicit intents
- Sending and receiving broadcast messages
- Working with menus and the action bar
- Adding a navigation drawer
- Advanced navigation techniques
- Removing activities from the back stack