0
        <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=".MainActivity">
        <item
            android:id="@+id/action_settings"
            android:title="Settings"
            android:orderInCategory="100"
            app:showAsAction="never" />
        <item android:id="@+id/action_search"
            android:orderInCategory="200"
            android:title="Search"
            android:icon="@android:drawable/ic_search_category_default"
            app:showAsAction="ifRoom" />
        <item android:id="@+id/action_user"
            android:orderInCategory="300"
            android:title="User"
            android:icon="@android:drawable/ic_dialog_info"
            app:showAsAction="ifRoom" />
    </menu>

I'm experimenting with android action bar and I'm confused how the settings and other actions are added to my action bar from the menu. How did android determine that the first item in my list is to be added the three dot menu?

enter image description here

1 Answer 1

0

Because you asked android to not show it as action, like this:

app:showAsAction="never"

while for other items you show them when there is enough space to show:

app:showAsAction="ifRoom"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.