I'm trying to do some things on the ActionBar in Android.
I've already added new items in the right side of the action bar.
How can I change the left side of the action bar? I want to change the icon and the text, and I want to add a "Back Button" in the action bar for the other screens
Go to manifest in which specific activity you want to change Action bar Title name and write android:label="Title name"
If you want to change the Action bar title just give the following 1 line code in the onCreate() of your Activity
For that, you can do it in 2 ways: XML or Java. See here: How to change the text on the action bar
So:
XML:
Java:
For set Title :
For set Icon :
You just need to add these 3 lines of code. Replace the icon with your own icon. If you want to generate icons use this
I used the following call inside
onNavigationItemSelected
: