How to change the index icon of option menu?
I mean icon (3).
Here is my code:
@Override public boolean onCreateOptionsMenu(Menu menu) { MenuInflater inflater = getMenuInflater(); inflater.inflate(R.menu.options, 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" />
To replace an app's default action bar with a Toolbar : Create a new custom theme and modify the app's properties so that it uses this new theme. Disable the windowActionBar attribute in the custom theme and enable the windowNoTitle attribute. Define a layout for the Toolbar .
The ActionBar, now known as the App Bar, is a consistent navigation element that is standard throughout modern Android applications. The ActionBar can consist of: An application icon. An "upward" navigation to logical parent.
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> <!-- 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> </style>
This is how it can be done. If you want to change the overflow icon in action bar
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With