Search code examples
androidandroid-layoutandroid-activity

Programmatically make app FULL SCREEN in Android


I know that an app can be made full screen by tag in the manifest of the activity android:theme="@android:style/Theme.NoTitleBar.Fullscreen" Is it possible to switch to full screen mode from within the app, programmatically?


Solution

  • add two lines...

    requestWindowFeature(Window.FEATURE_NO_TITLE); 
    this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
    setContentView(R.layout.main);