Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove the title when launching android app?

I already remove the title in onCreate() method.

protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    final ActionBar actionBar = getActionBar();
    actionBar.setHomeButtonEnabled(false);
    actionBar.setDisplayShowHomeEnabled(false);
    actionBar.setDisplayUseLogoEnabled(false);
    actionBar.setDisplayShowTitleEnabled(false);
}

after launched

The title is not displayed. But still appears when launching the app.

launching the app

And I can use

this.requestWindowFeature(Window.FEATURE_NO_TITLE);

or put

android:theme="@android:style/Theme.NoTitleBar.Fullscreen"

into manifest file because I'm using actionBar. If I did that, the app crashes.

So, my question is, is there any way to remove the title when the app is launching because I am gonna put a splashscreen here. Thanks.

-----------

PLEASE NOTICE:

Thanks for your answers, but I clearly said that I already used actionBar.setDisplayShowTitleEnabled(false); to hide the title bar of the activity. (as shown in the first picture) BUT the title bar still appears in the launching screen (as shown in the second picture.)

and

this.requestWindowFeature(Window.FEATURE_NO_TITLE);

and

android:theme="@android:style/Theme.NoTitleBar.Fullscreen"

would lead to crash launch. This happens after I used actionbar.

like image 782
Kyle Xie Avatar asked Jul 24 '13 04:07

Kyle Xie


People also ask

How do I remove the title bar from my app?

So basically we just need to change DarkActionBar to NoActionBar. NoActionBar theme prevents the app from using the native ActionBar class to provide the app bar. Thus it removes the title of every activity.

Which method is used to hide the activity title?

Just use getActionBar(). hide(); in your main activity onCreate() method. Save this answer.


1 Answers

I had the same problem.

Personally, I solved it by replacing my Activity inheritance from ActionBarActivity to Activity.

Hope this will help someone...

like image 61
Anonymous Avatar answered Oct 12 '22 22:10

Anonymous