Action Button goes to Overflow of the Action Bar

My menu is defined as:

<menu 
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    tools:context="com.opendoors.registration.BusinessProfActivity" >

    <item
        android:id="@+id/action_done"
        android:title="@string/action_done"
        android:icon="@drawable/ic_action_accept"
        app:showAsAction="ifRoom"/>

</menu>

Despite using ifRoom in showAsAction, my button still goes to the overflow menu.

I have also tried replacing:

xmlns:app=”http://schemas.android.com/apk/res-auto”

with

xmlns:compat="http://schemas.android.com/apk/res-auto"

as well as

app:showAsAction=”ifRoom” with compat:showAsAction=”ifRoom”

However, that doesn’t work either, even though it was suggested in similar questions. What am I missing?

Maybe the following error might have something to do with this?

06-10 04:50:34.541: E/AndroidRuntime(1697): java.lang.RuntimeException: Unable to
instantiate application android.app.Application: java.lang.IllegalStateException: Unable
to get package info for com.mypackage.app; is package not installed?

Answer

Try this:android:showAsAction="ifRoom"

Leave a Reply

Your email address will not be published. Required fields are marked *