Android – Activity in Fullscreen Mode

Do you want your Activity to run in fullscreen mode? Any of these two snippets will do the trick:

  • Look into your AndroidManifest.xml for the activity you want maximized. Add this inside its block:
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
  • Add these lines at the beginning of your onCreate() method. Remember to call setContentView() afterwards.
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
this.getWindow().setFlags( WindowManager.LayoutParams.FLAG_FULLSCREEN,
            WindowManager.LayoutParams.FLAG_FULLSCREEN);

2 comments

  1. just what I needed.
    Thanks!

Leave a Reply

You must be logged in to post a comment.