

My menu items got out of the overflow menu and again appeared as icons in each ActionBar.

In case if you are not aware of creating an app in android studio check this article Android Hello World App. Once I got all of the application compatibility libraries out of my Java code and switched to this setting: Create a new android application using android studio and give names as OptionsMenu. Android O introduces an new application icon format called adaptive icons, intended to make all icons on a device more coherent. In short, to fix this problem I just had to add this setting to my menu item definitions: android:showAsAction="ifRoom"įor example, I have one menu defined in an XML file named res/menu/menu_main.xml, and its source code looks like this:Īs you can guess from one of the comments, I used to use this approach:īut this approach IS NOT NEEDED unless you’re using the Android compatibility libraries. When I did this, all of my menu item icons disappeared from the action bars, and they appeared only as text in the overflow menus. I recently upgraded an Android application I’m working on to get away from all of the “application compatibility” stuff and only use Java classes that are not in the compatibility libraries.
