2

So I have problem in Android. Can't make my layouts fullscreen. I tried changing their themes but nothing happens when I run the app, but in layout preview, it's fullscreen. What to do?

Atul O Holic
  • 6,692
  • 4
  • 39
  • 74
Luka Bulatovic
  • 357
  • 5
  • 19

2 Answers2

3

Did you try this in your Activity (in OnCreate) :

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

?

nhaarman
  • 98,571
  • 55
  • 246
  • 278
Tifoo
  • 131
  • 1
  • 1
  • 8
0

Themes can be set inside the styles.xml file directly. And Theme.Holo.Dark is what I guess you are looking for (perhaps you dont want your layout to be black or something :)). There are many more options available you can try. Infact you can even create your own custom theme. :)

Here's the google guide for the same. http://developer.android.com/guide/topics/ui/themes.html

Atul O Holic
  • 6,692
  • 4
  • 39
  • 74
  • I don't seem to have Theme.Holo.Dark . Is this because of API version I use? An error pops up telling me that this theme can't be found in styles. – Luka Bulatovic Feb 14 '14 at 11:14
  • Which API version are you using and can you post the styles the way you are implementing it. Also, just try adding android:theme="@android:style/Theme.Holo.Light" to your activity in the manifiest file. – Atul O Holic Feb 14 '14 at 11:18
  • That's exactly the way I tried to put in inside app. My min-sdk is 8, target is 18, but the sdk I'm compiling with is API 10. – Luka Bulatovic Feb 14 '14 at 11:37