5

Please help me understand. I read somewhere saying that if I set up android:targetSdkVersion="14. These 3-dots will be gone.

Why these 3-dots still show up on mine?

They don't show up until I come back from another activity. I pressed the menu key after I came back from another activity, they showed up....

I am using actionbar menus so I don't need these ugly 3-dots on my app.

How can I remove them completely?

Thanks

Manifest:

  <uses-sdk
    android:minSdkVersion="14"
    android:targetSdkVersion="19" />

<application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/MyAppActionBarTheme" >

MainActivity:

  @Override
public boolean onCreateOptionsMenu(Menu menu) {
    // Inflate the actionbar menu; this adds items to the action bar.
    getMenuInflater().inflate(R.menu.actionbar_menu, menu);                 
    return super.onCreateOptionsMenu(menu);
}
User2014
  • 87
  • 3
  • 9
  • well wherever that somewhere is you read that is wrong because that does not get rid of it. it is there because your menu items cannot all fit on the action bar and go into the overflow menu (3 dots) – tyczj Sep 03 '14 at 19:09
  • Note that your manifest does not do what you say it does... you are still setting targetSdkVersion to 19, not 14. There might be more information here: https://stackoverflow.com/questions/13092808/three-dot-action-overflow-menu-in-actionbar – IvyMike Sep 03 '14 at 19:17

4 Answers4

6

Add the following function to your activity:

@Override 
public boolean onPrepareOptionsMenu(Menu menu) {
    MenuItem settingsItem = menu.findItem(R.id.action_settings);
    settingsItem.setVisible(false);
    return false; 
}

Edit: Sorry try with return false instead of return true!

Nyx
  • 2,233
  • 1
  • 12
  • 25
0

in menu.xml u can add android:showAsAction="" with these values never,ifRoom,always,withText,collapseActionView you can use them in | combinations.


in you case you can use android:showAsAction="always"

Sagar Pilkhwal
  • 3,998
  • 2
  • 25
  • 77
  • 1
    Thanks for the answer. I just set all my actiobar menus to android:showAsAction="always", so they overlap these overflow 3-dots menu. Now these 3-dots are no longer visible.... Thanks – User2014 Sep 03 '14 at 20:21
0

If you go into you ~res/menu/main.xml there should be some code within the tag

<item> 
    //setting button code is here
</item>

Just delete all that. Then go into your main activity and delete the corresponding code which should be in onOptionsItemSelected().

C'est voila.

catavaran
  • 44,703
  • 8
  • 98
  • 85
Eltee
  • 87
  • 3
0

I just thought i should share the easiest process of removing the three dots...

  1. go to the menu folder
  2. go to the second dropdown .xml
  3. view the design on the right pane after clicking on the layout you will see a checkbox which says visible check and uncheck it to make it invisible.
  4. then the 3dots is gone
Jon
  • 9,156
  • 9
  • 56
  • 73
Engrtunze
  • 30
  • 1
  • 1
  • 7