48

I want to set my application to full screen view. I got the idea to set it in an individual activity using FullScreen and NoTitlebar, but i want to set it in my Manifest XML file for the whole application not for each activity... Is this possible?

Help me... Thanks.

Greg T
  • 3,278
  • 3
  • 37
  • 39

6 Answers6

114

To set your App or any individual activity display in Full Screen mode, insert the code

<application 
    android:icon="@drawable/icon" 
    android:label="@string/app_name" 
    android:theme="@android:style/Theme.NoTitleBar.Fullscreen">

in AndroidManifest.xml, under application or activity tab.

Mark Mooibroek
  • 7,636
  • 3
  • 32
  • 53
  • But is it Work in manifest while adding it in to the Application tag. . . ? –  Apr 22 '11 at 05:55
  • Now if i want to set the Titlebar but in the center instead of the Default left side. . . is it possible to set it ? –  Apr 22 '11 at 06:06
  • that wuold be styling: http://stackoverflow.com/questions/2665507/custom-title-bar-without-padding-android – Mark Mooibroek Apr 22 '11 at 06:09
  • On ICS (and perhaps all builds) it seems that the Activity theme overrides the Application theme. Adding the same android:theme attribute to the Activity seems to sort this out. – sweetlilmre Apr 05 '12 at 10:49
  • in lollipop it hides to topbar(notification bar) but cant hide the bottom bar(which contains back btn, recent app and home button). – Bhaumik Belani Jun 06 '16 at 14:06
73

Another way: add windowNoTitle and windowFullscreen attributes directly to the theme (you can find styles.xml file in res/values/ directory):

<!-- Application theme. -->
<style name="AppTheme" parent="AppBaseTheme">
    <item name="android:windowNoTitle">true</item>
    <item name="android:windowFullscreen">true</item>
</style>

in the manifest file, in application specify your theme

<application
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
validcat
  • 6,158
  • 2
  • 29
  • 38
  • 3
    yea, very much thanks to your answer... what's left to say: "you can find the application theme under res/values/styles.xml".... it took me some time to find that there^^ really thanks, man... – Martin Frank Mar 17 '14 at 13:17
10

If your Manifest.xml has the default android:theme="@style/AppTheme"

Go to res/values/styles.xml and change

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

to

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

And the ActionBar is disappeared!

Sandeep Yohans
  • 929
  • 1
  • 14
  • 36
menepet
  • 796
  • 13
  • 17
6

In AndroidManifest.xml, set android:theme="@android:style/Theme.NoTitleBar.Fullscreen"in application tag.

Individual activities can override the default by setting their own theme attributes.

Nibha Jain
  • 7,742
  • 11
  • 47
  • 71
bluekyg
  • 217
  • 1
  • 2
3

Try using these theme: Theme.AppCompat.Light.NoActionBar

Mi Style XML file looks like these and works just fine:

<resources>

<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
    <!-- Customize your theme here. -->
    <item name="colorPrimary">@color/colorPrimary</item>
    <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
    <item name="colorAccent">@color/colorAccent</item>
</style>

Pablo
  • 456
  • 2
  • 7
  • 18
0

This seems to be an old questions with some old answers. We found that the easiest way to do this in a new project is to edit the res/values/themes/themes.xml file.

Actionbar: Change the parent attribute in the style element to "Theme.MaterialComponents.DayNight.NoActionBar" like this

<style name="Theme.WeatherDisplay" parent="Theme.MaterialComponents.DayNight.NoActionBar">

Status bar: Add the following line under the style element

<item name="android:windowFullscreen">true</item>

Here is the resulting themes.xml

<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. -->
<style name="Theme.NameOfApp" parent="Theme.MaterialComponents.DayNight.NoActionBar">
    <!-- Primary brand color. -->
    <item name="colorPrimary">@color/purple_500</item>
    <item name="colorPrimaryVariant">@color/purple_700</item>
    <item name="colorOnPrimary">@color/white</item>
    <!-- Secondary brand color. -->
    <item name="colorSecondary">@color/teal_200</item>
    <item name="colorSecondaryVariant">@color/teal_700</item>
    <item name="colorOnSecondary">@color/black</item>
    <!-- Status bar color. -->
    <item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>
    <!-- Customize your theme here. -->
    <item name="android:windowFullscreen">true</item>
</style>
Jesper Lundin
  • 168
  • 1
  • 8