Nishant Tanwar
Nishant Tanwar

Reputation: 383

Android remove title bar from Action bar

I have an activity in my app, which is using swipeable tabs with action bar

For example :-

this tutorial

So my question is to add action bar to my activity and remove titlbar

similar question

Upvotes: 2

Views: 1113

Answers (3)

Sanjay Kushwaha
Sanjay Kushwaha

Reputation: 70

Use this code in oncreate() method of activity before adding content:

 getWindow().requestFeature(Window.FEATURE_NO_TITLE)

Upvotes: 0

danidee
danidee

Reputation: 9634

Add this to your activity before calling setContentView();

this.requestWindowFeature(Window.FEATURE_ACTION_BAR | Window.FEATURE_NO_TITLE);
    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
             WindowManager.LayoutParams.FLAG_FULLSCREEN);

if that dosen't work try this

//use this to disable the icon from ActionBar
    getActionBar().setDisplayShowHomeEnabled(false);

    //use this to disable the application name from ActionBar
    getActionBar().setDisplayShowTitleEnabled(false);

Upvotes: 1

Optimistic
Optimistic

Reputation: 27

I'm unsure as to exactly what you class as a title bar but you could do this in XML by putting the following in your Android Manifest for a particular activity to remove your title bar.

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

Upvotes: 1

Related Questions