Android Notes: Full screen applications

Just a quick note on how to make an Activity run full-screen. Simply insert this magic into the Activity’s OnCreate()

super.onCreate(savedInstanceState);
/* ... etc ... */
requestWindowFeature(Window.FEATURE_NO_TITLE); 
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN );
/* ... rest of code ... */

You need this if playing with OpenGL ES, otherwise the screen doesn’t scale correctly.

About the Author