smartmouse smartmouse - 7 months ago 83
Android Question

How to change option menu icon in the action bar?

How to change the index icon of option menu?

enter image description here

I mean icon (3).

Here is my code:

public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(, menu);

return true;

And here is the XML file:

<item android:id="@+id/Bugreport"
android:title="@string/option_bugreport" />

<item android:id="@+id/Info"
android:title="@string/option_info" />

<item android:id="@+id/About"
android:title="@string/option_about" />


The following lines should be updated in app -> main -> res -> values -> 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 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>
    <item name="android:background">?android:attr/actionBarItemBackground</item>
    <item name="android:contentDescription">"Lala"</item>

This is how it can be done. If you want to change the overflow icon in action bar