Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android - How to remove app name from ActionBar

This is my app:

enter image description here

Now i want to remove the app name from my ActionBar...
I want it like this:

enter image description here

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>
like image 431
Lugarini Avatar asked Apr 10 '15 01:04

Lugarini


People also ask

How do I remove project name from Android toolbar?

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.

How do I get rid of the app bar?

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.

How do I remove the title bar from Kotlin?

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.

Which method is used to hide the activity title?

The requestWindowFeature(Window. FEATURE_NO_TITLE) method of Activity must be called to hide the title.


1 Answers

ActionBar actionBar = getActionBar();
actionBar.setDisplayShowTitleEnabled(false);
actionBar.setDisplayShowHomeEnabled(false);

Or you can just call actionbar.setTitle("")

like image 103
vincentzhou Avatar answered Sep 24 '22 13:09

vincentzhou