Android Menu

Menus have traditionally been the way to navigation.

Nowadays more and more navigation facilities like Tabs, ViewPager and BottomNavigationBar are available.

Advantages of Menus

However, menus are probably still the easiet and most popular and advantageous. This is because of the following:

  1. They are easy to use for users with respect to navigation.

  2. Menus can confine more menu items in a small space compared to other navigation utilities like the navigationview, tabs and bottom bar.

  3. Menus are typically easy to customize as we represent them via XML in many cases.

  4. It's relatively easier to apply animations to menu items than other navigation components.

Top Android Menu Examples

Let's look at some examples.

ContextMenu support has been in android since API level 1. It's an extension of menu and implements Menu interface. It's actually an interface itself.

ContextMenus are usually shown when users long click view. It's shown by registering contextmenu using the registerForContextMenu(view) and then overriding onCreateContextMenu().

In this example we look at showing a contextmenu when user long clicks/presses a listview item. We also see how to handle contextmenu items action events, in this case only showing a toast message when user selects a context menuitem.


How do You Feel after reading this?

According to scientists, we humans have 8 primary innate emotions: joy, acceptance, fear, surprise, sadness, disgust, anger, and anticipation. Feel free to tell us how you feel about this article using these emotes or via the comment section. This feedback helps us gauge our progress.

Help me Grow.

I set myself some growth ambitions I desire to achieve by this year's end regarding this website and my youtube channel. Am halfway. Help me reach them by:


What do You Think

Dear readers drop us your comments below. We are building a community of students and learners. Start by dropping us your suggestions below. What tutorials do you want us to do for example? Where can we improve? What are some awesome resources out there? Do you have any code you want to share with us?
By the way that example or snippet you have lying in your computer can really help beginner programmers. We can share it here with other students.

Previous Post Next Post