How to make android Activity full screen

In this android tutorial, we are going to learn how to make android activity full screen. This can come in handy in android apps and games especially when we need to design an intro activity or menu activity. By reading this tutorial it implies that you are looking for a way to create a full screen activity, if you have little or no knowledge about android development, I will suggest you read our beginner’s android tutorials here.

In other to make the activity fullscreen to look good we are going to add a background image to our activity. You can choose not to use any image or you can get your own image and use it. If you want to use the same image I used, you can download it at the end of this article.

You can see the environment and tools we used for this tutorial below
Windows XP
Eclipse (ADT)
Samsung Galaxy Fame Lite
Min SDK 8
Target SDK 19

There is no better time to start creating our application than now. To create a new android application project, following the steps as stipulated below.

How to create a new Android project in Eclipse
Got to file menu
Click on New menu
Click on Android Application Project
Enter Project Name: Fullscreen
Package Name: com.example.fullscreen
Keep other default selections.
Continue to click on next button until Finish button is active
Then click on Finish Button

Ok, I think I did not inform you that there are two ways you can create a fullscreen activity in android; you can do it programmatically or in your project manifest file. I will show you how to accomplish both of them but first we have to do it programmatically.

Open your activity_main.xml and copy and paste this code on it. Please note that I have added only background information to it.

<RelativeLayout xmlns:android=""
    tools:context="com.example.fullscreen.MainActivity" >

Once we have finish with the snippet above, we will move over to the file and add the following code below.

package com.example.fullscreen;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.Window;
import android.view.WindowManager;
public class MainActivity extends ActionBarActivity {
	protected void onCreate(Bundle savedInstanceState) {
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);

	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(, menu);
		return true;
	public boolean onOptionsItemSelected(MenuItem item) {
		// Handle action bar item clicks here. The action bar will
		// automatically handle clicks on the Home/Up button, so long
		// as you specify a parent activity in AndroidManifest.xml.
		int id = item.getItemId();
		if (id == {
			return true;
		return super.onOptionsItemSelected(item);

That is all for the code. When you are done just run your code and you will see that your activity is now fullscreen.

The second way to achieve the same effect is to use our project Manifest file. Copy and paste this code on the activity you want to make fullscreen in your application manifest file.


You can download the source code for this project below. If you can’t download it, you can drop your email address and I will forward the source code to you.

You can see how that project looks in a device below.

android background

If you have any question, do not hesitate to ask.

Add a Comment