6

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.

Kyle Xie
  • 722
  • 1
  • 8
  • 28

12 Answers12

6

I had the same problem.

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

Hope this will help someone...

Anonymous
  • 61
  • 1
  • 2
0

Do this in your onCreate() method.

//Remove title bar

this.requestWindowFeature(Window.FEATURE_NO_TITLE);

//Remove notification bar

this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);

this refers to the Activity.

===========

EDIT:

if you are using ActionBarSherLock

final ActionBar bar = getSupportActionBar();
bar.setDisplayShowTitleEnabled(false);
Abdullah AlHazmy
  • 1,299
  • 1
  • 13
  • 22
  • the Window.FEATURE_BO_TILTE would lead to crash when launching the app. And I did setDisplayShowTitleEnabled(false) which hides the title bar of the activity but still does not hide it when launching it. – Kyle Xie Jul 24 '13 at 08:33
0

It might be crashing because you are using this.requestWindowFeature(Window.FEATURE_NO_TITLE); after setContentView();

Use this.requestWindowFeature(Window.FEATURE_NO_TITLE); in onCreate() of your Activity , before setContentView(); statement.

Brijesh Thakur
  • 6,768
  • 4
  • 24
  • 29
0

May be i am repeating the same which all are saying but i just need to confirm it.In manifest file have add the theme like the below which i added as sample or anyother way.

<application .... android:theme="@android:style/Theme.NoTitleBar.Fullscreen" android:largeHeap="true"> .. </application>

Just remove all other code related to hide title bar only andonly add this one in the manifest file it works for me.I hope it will work to you too.

Srinivasan
  • 4,481
  • 3
  • 28
  • 36
  • If you use the Tab Fragment example provided by developer.android.com, you will found you can't add this in the manifest file as it will crash... Don't know why – Kyle Xie Jul 30 '13 at 00:35
  • you just try this link dude.http://stackoverflow.com/questions/14403488/hiding-app-title-bar-in-android-pager – Srinivasan Jul 30 '13 at 05:57
0

Nick Butcher and Katherine Kuan wrote a nice Google Plus post about a smoother app launch experience:

https://plus.google.com/+AndroidDevelopers/posts/VVpjo7KDx4H

However, if you want to be compatible with Android versions below API 14 (for example using AppCompat), the only way I could achieve this is by using a separate launch activity using a theme with no actionbar.

teh.fonsi
  • 3,040
  • 2
  • 27
  • 22
0

Set your splashscreen as your main activity and set the theme to

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

create and intent to move your splash screen to your actual main activity

jleft
  • 3,457
  • 1
  • 23
  • 35
0

Use this:

 ActionBar bar = getActionBar();    
 bar.hide();

or

    ActionBar bar = getActionBar();
    bar.setDisplayShowHomeEnabled(false);
    bar.setDisplayShowTitleEnabled(false);
Ayaz Alifov
  • 8,334
  • 4
  • 61
  • 56
0

in res/values/styles.xml

find ...

<!-- Application theme. -->
<style name="AppTheme" parent="AppBaseTheme">
   <!-- All customizations that are NOT specific to a particular API-level can go here. -->
</style>

replacing for.

<!-- Application theme. -->
<style name="AppTheme" parent="AppBaseTheme">
    <item name="windowActionBar">false</item>
    <!-- All customizations that are NOT specific to a particular API-level can go here. -->
</style>

Save and compile...

0

Put below three line in onCreate Method before setContentview in your activity which want to display full screen

requestWindowFeature(Window.FEATURE_NO_TITLE); super.onCreate(savedInstanceState); getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);

Vishal Dasadiya
  • 2,585
  • 1
  • 14
  • 11
0

Hope below lines will help you

    getWindow().clearFlags(
            WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN); 
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
            WindowManager.LayoutParams.FLAG_FULLSCREEN);
-1

You can simply add full screen theme to that activity in your manifest file:

android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen"
Shani Goriwal
  • 2,111
  • 1
  • 18
  • 30
-1

In your AndroidManifest.xml in application tag set your theme to full screen like in below code.

android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
Jitesh Dalsaniya
  • 1,917
  • 3
  • 20
  • 36