Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

To create an Android application that occupies the whole screen, you need to set the application's theme to "fullscreen" in your AndroidManifest.xml file. Follow these steps:

  1. Open your project in Android Studio.
  2. Open the AndroidManifest.xml file located in the app/src/main directory of your project.
  3. Add the following code to the <application> tag:
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
  1. This will set the theme of your application to fullscreen, which will remove the status bar and navigation bar and occupy the entire screen.

  2. Make sure that the root element in your activity's layout file uses the "match_parent" attribute for both its width and height, like so:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent">
    <!-- your views here -->
</LinearLayout>
  1. Run your application to see it occupy the entire screen.

Note: If your application has multiple activities, you will need to set the fullscreen theme for each activity in the AndroidManifest.xml file.