Android How to - Make Activity Full screen








Question

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

Answer

/*from   www  .  jav a 2 s  .  c o  m*/
import android.app.Activity;
import android.view.Window;
import android.view.WindowManager;

class ActivityAttrUtils {
  public static void requestFullscreen(final Activity mActivity) {
    final Window window = mActivity.getWindow();
    window.addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
    window.clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
    window.requestFeature(Window.FEATURE_NO_TITLE);
  }
}