How to Make an Activity Fullscreen

14 votes · 16 comments

This code makes the current Activity Full-Screen. No Status-Bar or anything except the Activity-Window!

raw ·
copy
· download
public class FullScreen extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); setContentView(R.layout.main); } }
Add a comment

16 Comments

Alternatively you can add

android:theme="@android:style/Theme.NoTitleBar.Fullscreen"

to AndroidManifest.xml under

Reply · May 28, 2009, 10:54 p.m.

Thank you :)

Reply · March 22, 2011, 10:35 a.m.

tambien me gusta mas esta

Reply · June 22, 2012, 11:27 p.m.

tambien me gusta mas esta

Reply · June 22, 2012, 11:27 p.m.

Thanks. It works!

Reply · June 21, 2014, 7:16 p.m.

Many thanks !

Reply · Aug. 22, 2009, 12:06 a.m.

hei how to insert this patch to android? can u please give me the tutorial and what tools I need,,,,

Reply · March 10, 2011, 3:51 p.m.

I hope you will like my recommendation,More information can be found online at http://www.fashionmaternitydress.com http://www.bangaccessory.com http://www.petaccessoryonline.com

Reply · Jan. 13, 2012, 8:02 a.m.

Wow, so well. I consider computer programming is hard for me. Do you use language of C? http://www.topckit.com

Reply · Jan. 18, 2012, 2:12 p.m.

Thanks for sharing.

Reply · March 3, 2012, 2:58 a.m.

All Posts are really help full. Android is one of my favorite language. You are providing good knowledge. I am doing my graduation after that I am going to do programming. Thanks! Essay

Reply · April 7, 2012, 9:26 a.m.

Following is the code snapshot.

protected void setFullScreen(Context currContext) { ((Activity) currContext).requestWindowFeature(Windows.FEATURE_NO_TITLE); ((Activity) currContext).getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN); }

Call above function with as follows

setFullScreen(CurrActivity.this);

For more detailed example. Please check following blogs

http://meticulousapps.blogspot.in/2012/03/android-game-start-application-in-full.html

you can download free application at following

https://play.google.com/store/apps/developer?id=Meticulous+Apps

Reply · April 16, 2012, 10:35 a.m.

Vary helpful and simple. Thank you

Reply · April 3, 2013, 4:25 p.m.

Thank You! Thanks a lot !!!!!!!!!!!!!!!!!!!!!

Reply · March 22, 2014, 10:56 a.m.

hi i'm new in android coding while i create simple splash screen using above code.

ADT shows an error in setContentView(R.layout.main);

main cannot be resolved or is not a field

Reply · April 6, 2014, 7:06 p.m.

Check that you have a layout file "main.xml" under the res/layout folder.

Reply · June 18, 2014, 10:43 p.m.

Good job bro! Tnh :) (y)

Reply · April 11, 2014, 9:14 p.m.