Skip to content

Instantly share code, notes, and snippets.

@douzifly
Created June 13, 2014 03:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save douzifly/176d8072e0c0a2665379 to your computer and use it in GitHub Desktop.
Save douzifly/176d8072e0c0a2665379 to your computer and use it in GitHub Desktop.
Android FullScreen
public static void setFullScreen(Window window, boolean fullScreen) {
if (fullScreen) {
window.setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
} else {
window.clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
}
}
public static boolean isFullScreen(Window window) {
return (window.getAttributes().flags & WindowManager.LayoutParams.FLAG_FULLSCREEN) != 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment