Search This Blog

Mind freaker Stuff

Please Visit my new blog http://www.mindfreakerstuff.com for new articles related to web and mobile designing.

Thursday, January 19, 2012

How to set layout or activity full screen : Android App

There are two ways to  set layout or activity full screen  for android application

1) Add folowing code to your JAVA file
-Add Two line in red before "setContentView"


public class myFullScreen 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);
    }
}

OR

2) Add  folowing code

android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
to AndroidManifest.xml in your activity tag

1 comment: