Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>So, turns out it's pretty simple, I recently implemented in my app.</p> <p>The items that need to be shown in the overflow menu, nest them under one menu item as follows:</p> <pre><code>&lt;menu xmlns:android="http://schemas.android.com/apk/res/android" &gt; &lt;item android:id="@+id/empty" android:orderInCategory="101" android:showAsAction="always" android:icon="@drawable/ic_action_overflow"&gt; &lt;menu&gt; &lt;item android:id="@+id/action_settings" android:orderInCategory="96" android:showAsAction="never" android:title="@string/menu_settings" android:icon="@drawable/ic_action_settings"/&gt; &lt;item android:id="@+id/action_share" android:orderInCategory="97" android:showAsAction="never" android:title="@string/menu_share" android:icon="@drawable/ic_action_share"/&gt; &lt;item android:id="@+id/action_rate" android:orderInCategory="98" android:showAsAction="never" android:title="@string/menu_rate" android:icon="@drawable/ic_action_important"/&gt; &lt;item android:id="@+id/action_feedback" android:orderInCategory="99" android:showAsAction="never" android:title="@string/menu_feedback" android:icon="@drawable/ic_action_edit"/&gt; &lt;/menu&gt; &lt;/item&gt; &lt;/menu&gt; </code></pre> <p>Now, edit the main activity file as follows:</p> <pre><code>package com.example.test; //all your import statements go here Menu mainMenu=null; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.main, menu); mainMenu=menu; return true; } //Menu press should open 3 dot menu @Override public boolean onKeyDown(int keyCode, KeyEvent event) { if (keyCode==KeyEvent.KEYCODE_MENU) { mainMenu.performIdentifierAction(R.id.empty, 0); return true; } return super.onKeyDown(keyCode, event); } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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