0
votes

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?
3
if you want to display it always then use app:showAsAction="always"Syed Waqas

3 Answers

0
votes

Try this:android:showAsAction="ifRoom"

0
votes

Have you tried to use always instead of ifRoom?

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

You could try: app:showAsAction="always"