Android How to - Make Activity Full Screen








Question

We would like to know how to make Activity Full Screen.

Answer

//from  w  w  w .jav a2s. c  o m
import android.app.Activity;
import android.view.WindowManager;

public class Main {
  public static void setFullScreen(Activity activity) {
    activity.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
        WindowManager.LayoutParams.FLAG_FULLSCREEN);
  }
}