Search code examples
androidfullscreen

Fullscreen not working in Android App


At the beginning I had problems with the Title Bar, the theme had no effect on it.

So adding the line getActionBar().hide() in my onCreate() method in the main activity fixed this !

Now I am told to add the line

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

to the onCreate() method of my main activity (the activity I am trying to affect) and nothing is happening.

I have tried setting the theme to .FULLSCREEN and nothing.

What I get is a black frame around the app like this:

enter image description here

Now, this is not an emulator problem, the same thing happens when I run it on my Samsung Galaxy.

Why the black frame !! :'(


Solution

  • Did you check if you don't have any margin/padding in your xml file ? (and could you post code of the part you're having trouble with if it's not a margin/padding problem?)