This is my app:
Now i want to remove the app name from my ActionBar...
I want it like this:
my code:
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:myapp="http://schemas.android.com/apk/res-auto" >
<item
android:id="@+id/phone"
android:title="@string/phone"
android:icon="@drawable/phone"
myapp:showAsAction="ifRoom" />
<item
android:id="@+id/computer"
android:title="@string/computer"
android:icon="@drawable/computer"
myapp:showAsAction="ifRoom" />
</menu>
To remove the title bar/ action bar from your Android application, you can set the <style> tag in your application to NoActionBar . When you create a new Android application using Android Studio, the <style> tag for your application is commonly generated at Project -> app -> src -> main -> res -> values -> styles.
If you want to hide Action Bar from the entire application (from all Activities and fragments), then you can use this method. Just go to res -> values -> styles. xml and change the base application to “Theme. AppCompat.
Another way for removing the title specifically from an activity is by using a getSupportActionBar(). hide() method. Inside the activity's kotlin file, we need to invoke getSupportActionBar(). hide() method.
The requestWindowFeature(Window. FEATURE_NO_TITLE) method of Activity must be called to hide the title.
ActionBar actionBar = getActionBar();
actionBar.setDisplayShowTitleEnabled(false);
actionBar.setDisplayShowHomeEnabled(false);
Or you can just call actionbar.setTitle("")
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