Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change three dots button on android to other button

Tags:

I wanna change the three dots button on Android to other button which is an "Add" button. How to do it? I have changed set the button in my drawable, but it keep prompt the three dot button.

Thanks

like image 397
chemat92 Avatar asked May 15 '15 19:05

chemat92


People also ask

What are three dots called button?

The kebab menu, also known as the three dots menu, and the three vertical dots menu, is an icon used to open a menu with additional options. The icon is most often located at the top-right or top-left of the screen or window. The picture shows an example of the kebab menu icon in Google Chrome.

How do I add three dots to my Android toolbar?

Right-click res folder and create a new Resource Directory of type menu. Right-click the menu directory and create a new resource file. From there you can drag and drop a menu item from the XML design. That should give you the 3 dots.


Video Answer


2 Answers

Sorry i can't reply as a comment, but i'm guessing you want to change the actionbar overflow menu icon. If so you can do it in styles.xml.

 <!-- Application theme. -->
<style name="AppTheme" parent="AppBaseTheme">
    <!-- All customizations that are NOT specific to a particular API-level can go here. -->
    <item name="android:actionOverflowButtonStyle">@style/MyActionButtonOverflow</item>
</style>

<!-- Style to replace actionbar overflow icon. set item 'android:actionOverflowButtonStyle' in AppTheme -->
<style name="MyActionButtonOverflow" parent="android:style/Widget.Holo.Light.ActionButton.Overflow">
    <item name="android:src">@drawable/ic_launcher</item>
</style>

Original post: How to change option menu icon in the action bar?

like image 194
Lalsangpuia Ralte Avatar answered Oct 13 '22 17:10

Lalsangpuia Ralte


Sorry I don't have enough reputation to post a comment. Here is the best answer I found, its one line of code:

myToolbar.setOverflowIcon(ContextCompat.getDrawable(getApplicationContext(),R.drawable.my_drawable));

The link for the original answer is here: https://stackoverflow.com/a/35790470/4575772

like image 30
NNN Avatar answered Oct 13 '22 18:10

NNN