Menu function key not displayed on Android Lollipop devices [Nexus 9 and nexus 5]

I canโ€™t find the Menu softkey on my Nexus 9 and nexus 5 [Android Lollipop version of Android]. All applications that I developed that contained the option menu did not display the Menu softkey . Therefore, I cannot access this option menu .

Also, some of my applications do not use the Actionbar/Toolbar due to their design requirements, so I am looking for a solution without adding an Actionbar/Toolbar .

So, I was wondering if there is a way to show Menu softKey in Android Lollipop ?

Updated:

enter image description here This is an example application that I found on my Nexus 9. As you can see, it has an action overflow button for legacy applications. Can someone tell me how this happened?

+5
source share
2 answers

According to this blog post: http://android-developers.blogspot.com/2012/01/say-goodbye-to-menu-button.html

If your application runs on a device without a special menu button, the system decides whether to add action overflows to the navigation based on the API levels that you declare to support in the manifest. The logic comes down to the following:

If you set minSdkVersion or targetSdkVersion to 11 or higher, the system will not add an obsolete overflow button.

Otherwise, the system will add an obsolete overflow button when launched on Android 3.0 and above.

The only exception is that if you set minSdkVersion to 10 or lower, set targetSdkVersion to 11, 12 or 13, and you are not using ActionBar, the system will add an outdated overflow button when the application starts. on a phone with Android 4.0 or higher.

So basically check out the manifest file.

+6
source

Add

  • YourActivity Extends AppCompatActivity
  • Add the onCreateOptionsMenu method and inflate the menu (getMenuInflater (). Inflate () (R.menu.menu_file, menu);
  • Add in res-> menu-> menu_test.xml โ†’ any element with (app: showAsAction = "ifRoom")
+2
source

Source: https://habr.com/ru/post/1208881/


All Articles