I don’t know what the real name of this is, but I want to change the top menu for an image or button. Someone can tell me what the name is and how do that in my android aplication?. something like it!!!
Asked
Active
Viewed 293 times
2 Answers
0
If you mean the custom text, you can add custom vews in your toolbar. The toolbar is just a viewgroup where you can add views inside. See this as an example.
If you mean to add a custom image instead of the back arrow, you can switch it with the toolbar.setNavigationIcon(Drawable drawable) method.
If you want to display the default arrow, then try with this (after setting the toolbar).
ActionBar actionBar = getSupportActionBar();
if (actionBar != null) {
actionBar.setDisplayHomeAsUpEnabled(true);
}

Community
- 1
- 1

Dr NotSoKind
- 225
- 1
- 5
- 14
0
in your menu xml add this in the item tag android:icon="@drawable/youricon"
app:showAsAction="always"

Shia G
- 1,444
- 11
- 10