How to FullScreen Activity in Application Android Studio

 How to FullScreen Activity in Application using Android Studio.


Suppose I want to hide in Main activity then, at first open manifest file and edit it with theme.


<activity android:name=".MainActivity"

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


Now you can see action bar is hidden. So we need to hide status bar too. And finally it will be full screen activity.


Open mainactivity.java file now paste below code.


            View decorView = getWindow().getDecorView();

            int uiOptions = View.SYSTEM_UI_FLAG_FULLSCREEN;

            decorView.setSystemUiVisibility(uiOptions);