Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid - Remove "More actions" button from the ActionBar
    text
    copied!<p>I have an ActionBar that should display the action buttons in a custom way. For this I created a custom view and attached it to the ActionBar. </p> <p>One thing to mention is that I am using a <strong>menu.xml</strong> resoure file to load the options menu and display them on a smartphone, but do not display them on tablet, instead use a custom view. For this I market every menu item in the xml as: <code>android:showAsAction="never"</code></p> <p>Everything looks fine, except one little thing that still remains on the right of the ActionBar - the "More" button. </p> <p>How can I remove it? </p> <p><img src="https://i.stack.imgur.com/ipLe6.png" alt="enter image description here"></p> <p>I tried this: </p> <pre><code>ActionBar bar = activity.getActionBar(); bar.removeAllTabs(); </code></pre> <p>but the "more" button still remains there.</p> <p><strong>EDIT:</strong><br> This is my menu.xml file:</p> <pre><code>&lt;menu xmlns:android="http://schemas.android.com/apk/res/android" &gt; &lt;item android:id="@+id/menu_username" android:icon="@drawable/menu_username" android:orderInCategory="0" android:showAsAction="never" android:title="@string/menu_username"&gt; &lt;menu&gt; &lt;item android:id="@+id/menu_logout" android:title="@string/menu_logout"/&gt; &lt;/menu&gt; &lt;/item&gt; &lt;item android:id="@+id/menu_settings" android:icon="@drawable/menu_settings" android:orderInCategory="1" android:showAsAction="never" android:title="@string/menu_settings"/&gt; &lt;item android:id="@+id/menu_search" android:icon="@drawable/menu_search" android:orderInCategory="1" android:showAsAction="never" android:title="@string/menu_search"/&gt; &lt;/menu&gt; </code></pre> <p><strong>Please note I still want to inflate this menu on a smartphone, but don't want to use it on a tablet.</strong></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload