-2

I want to remove this unwanted title bar

enter image description here

I cant remove this

i have tried

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

3 Answers 3

4

This is not a title bar. This is ActionBar or Toolbar. You should extend your application theme from Theme.AppCompat.NoActionBar. Or just add android:theme="@style/Theme.AppCompat.NoActionBar" to <application/> tag in AndroidManifest.xml

Sign up to request clarification or add additional context in comments.

Comments

1

add the following to your manifest:

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

That should sort it, replace Theme with your actual theme if required, this line goes within the application part of the manifest or can go where the activity is declared.

1 Comment

Gildors answer is better than mine, From your code I thought it as a TitleBar but Gildor believes it is an ActionBar or a ToolBar, please check out his answer :)
0

You need to set your content view AFTER you have written the two lines

//Remove title bar this.requestWindowFeature(Window.FEATURE_NO_TITLE); //Remove notification bar this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); //set content view AFTER ABOVE sequence (to avoid crash) this.setContentView(R.layout.layout_name); 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.