I took an older project of mine and imported it into Android Studio. As part of it, I had to change inheritance from Activity to AppCompetActivity to support ActionBar with its new API.
Now I have an unexpected behavior as a result: All menu items are flattened instead of being hidden behind the three dots menu icon like so:
Inheriting from Activity:
Inheriting from AppCompatActivity:
Any Idea?
Edited:
Here is my menu.xml:
Need to update namespace android:showAsAction
to app:showAsAction
attribute. Use the following code:
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:orderInCategory="100"
android:title="Menu Item 1"
app:showAsAction="never" />
<item
android:orderInCategory="100"
android:title="Menu Item 2"
app:showAsAction="never" />
</menu>