How do I remove the title bar? [duplicate]

3

I'm having trouble removing the Title bar from the application, I've already tried putting requestWindowFeature(Window.FEATURE_NO_TITLE); on OnCreate, nothing. For the <application android:theme="@android:style/Theme.Black.NoTitleBar"> manifest, that way, it even exits in Preview, but when I run the application either through the emulator, or in the mobile phone, the bent bar is again. Any light?

    
asked by anonymous 12.06.2016 / 03:05

1 answer

0

try this:

@Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
                WindowManager.LayoutParams.FLAG_FULLSCREEN);
        setContentView(R.layout.main);
    
21.06.2016 / 19:30