Skip to content
Related Articles

Related Articles

Improve Article

How to Enable Full-Screen Mode in Android?

  • Last Updated : 21 Apr, 2021

In this article, we are going to learn how to enable full screen in Android Studio. Like if we are especially viewing an image then we want to view that on full screen. Here what we are going to implement is that we are basically hiding the navigation, status bar, and enabling the full-screen mode. We are going to discuss 4 different methods for doing this task.

Method 1

Following is the code to hide the navigation and enabling full-screen mode.

// This is the code to hide the naviagtion and enabling full screen mode
View.SYSTEM_UI_FLAG_IMMERSIVE
                            // Set the content to appear under the system bars so that the
                            // content doesn't resize when the system bars hide and show.
                            | View.SYSTEM_UI_FLAG_LAYOUT_STABLE
                            | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
                            | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
                            // Hide the nav bar and status bar
                            | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
                            | View.SYSTEM_UI_FLAG_FULLSCREEN);

Method 2

Made these changes in your manifest.xml file

android:theme="@style/Theme.AppCompat.Light.NoActionBar"

Method 3

Made these changes in your styles.xml file

<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
    <!-- Customize your theme here. -->

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

Method 4

Made these changes in your styles.xml file

<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
Want a more fast-paced & competitive environment to learn the fundamentals of Android?
Click here to head to a guide uniquely curated by our experts with the aim to make you industry ready in no time!
My Personal Notes arrow_drop_up
Recommended Articles
Page :