Reputation: 383
I have an activity in my app, which is using swipeable tabs with action bar
For example :-
So my question is to add action bar to my activity and remove titlbar
Upvotes: 2
Views: 1113
Reputation: 70
Use this code in oncreate() method of activity before adding content:
getWindow().requestFeature(Window.FEATURE_NO_TITLE)
Upvotes: 0
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
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