0

Good morning. I've been using android studio to try to make an activity/whole app fullscreen.

There are two methods I have tried, one is in the manifest:

<activity android:name=".ActivityName"
    android:label="@string/app_name"
    android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen">
</activity>

(and another attempt in the manifest)

android:theme="@style/FullscreenTheme" >

(and another attempt in the manifest)

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

And the other is in code (onCreate)

ActionBar actionBar = getActionBar();
actionBar.setDisplayShowTitleEnabled(false);

Time and time again the bar at the top appears in all my activities as seen in the image below.

Does anyone know how to make that dissapear so its fullscreen please.

enter image description here

kkuilla
  • 2,226
  • 3
  • 34
  • 37
user3652876
  • 3
  • 1
  • 5
  • possible duplicate of [Fullscreen Activity in Android?](http://stackoverflow.com/questions/2868047/fullscreen-activity-in-android) – Lamorak Jul 28 '15 at 08:02
  • [This answer](http://stackoverflow.com/a/28301744/4584675) should help you – Lamorak Jul 28 '15 at 08:03

4 Answers4

0

In the onCreate of your activities, use

getActionBar().hide();
milez
  • 2,201
  • 12
  • 31
0

I think this will work android:theme="@android:style/Theme.Holo.NoActionBar"

Prathmesh Swaroop
  • 611
  • 1
  • 5
  • 13
0

I usually do this:

protected void onCreate(Bundle savedInstanceState) {
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    .
    .
    .
0

1) Add theme for Activity

<activity
    android:name=".MyActivity"
    android:theme="@android:style/Theme.NoTitleBar"/>

OR

2) Handle in Activity

this.requestWindowFeature(Window.FEATURE_NO_TITLE);
this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
this.setContentView(R.layout.main_layout); 
Ganesh AB
  • 4,652
  • 2
  • 18
  • 29
  • Applying the theme part to activities in the AndroidManifest.xml file worked. For some reason when trying to have a single Theme file which is referenced from has not worked. Can someone recommend what the best thing to put in each android:theme part is? It seems being able to remove android:theme in each and using a single one in would be best right? – user3652876 Jul 28 '15 at 10:00
  • @user3652876 You are right instead of multiple activities you can use theme to application. but now days developer use multiple fragments and single activity. – Ganesh AB Jul 29 '15 at 10:45