Here’s a quick post that will guide you through a few very simple ways through which you can make you application run in a full screen i.e. without title and the notification bar of the Android OS.

1. You can add the following piece of code to your OnCreate function of your activity to make it run in full screen mode:

requestWindowFeature(Window.FEATURE_NO_TITLE);

getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); 

Note that the first call to requestWindowFeature function might be optional for you in case you want to run the application in full screen but you also need to show the title.

2. The second method, which is more preferred in my opinion, is to use the AndroidManifest.xml file and add following attribute to your activity (in your <activity> tag, of-course):

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

The main difference between these two methods is that the first one will be called a bit late and you will see the notification bar appearing and then going in the background. The second method however avoids this behavior and make your application run in full screen straight away.

Advertisements