Full screen activity/application

Full screen activity/application

Set your android application on fullscreen view, removing the default Android task bar and the application title bar. We have two choices: editing the Activity with Java code and the other one is edit the Activity from the manifest file.

// YourActivity.java

  @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);
  }
<!-- AndroidManifest.xml -->

<activity android:name=".YourActivity"

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