I want to hide the title bar using code for some of my activities.
I have used the following code
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
//Remove notification bar
this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
the second line is working for full screen but it shows the application title. Lets say for my splash screen i want to hide my title. The 1st line of code crashes my application. Please help me if we can do it using code.
thanks.
You should call this before your setContentView() method, did you do that?
You could always do it in your manifest by adding
android:theme="@android:style/Theme.NoTitleBar"
to your activityIf you are using API 11 and above
To hide title bar and status bar:
To show title bar and status bar:
for remove Application Titlebar then add this line
requestWindowFeature(Window.FEATURE_NO_TITLE);
before setContentView(R.layout.main);