-1

How to remove the title bar from my app.?

I tried by making changes in manifest file by adding "NoTitleBar" at the end of theme and i also followed the answer given in this question

"How to hide the title bar for an Activity in XML with existing custom theme"

But none of them worked for me.Please help

Community
  • 1
  • 1
Deepinder Singh
  • 729
  • 10
  • 18

3 Answers3

1

Use this:

requestWindowFeature(Window.FEATURE_NO_TITLE); 

in your Activity.

breakline
  • 5,776
  • 8
  • 45
  • 84
0

You could add in your activity before you set view in oncreate function.

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

It is because your activity is extending ActionBarActivity. You could replace by extending Activity for your activity.

public class MainActivity extends Activity

I hope this will solve your problem.

Sujit Devkar
  • 1,195
  • 3
  • 12
  • 22
0

In the AndroidManifest.xml file you can find a tag <application That tag contains android:theme attribute, it must be something like "@style/AppTheme". Open the file styles.xml. Find a tag style name="AppTheme" and change its parent attribute to be Theme.AppCompat.Light.NoActionBar.

In my case it is

<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">

To hide the title bar on the preview mode click on the button next to the orientation switcher button, that must open a popup where you can choose a style. Choose one with NoActionBar, for example DeviceDefault.Light.NoActionBar

Hovo
  • 790
  • 4
  • 21