Android – Activity in Fullscreen Mode

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

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);

Related Posts

2 COMMENTS

  1. rednuht
    March 07, 2010 23:38 Reply

    just what I needed.
    Thanks!

Leave a reply