Skip to content

Instantly share code, notes, and snippets.

@yava555
Last active December 22, 2015 06:45
Show Gist options
  • Save yava555/0fd28087059e69bf8a50 to your computer and use it in GitHub Desktop.
Save yava555/0fd28087059e69bf8a50 to your computer and use it in GitHub Desktop.
Activity Fullscreen
@Override
public void onWindowFocusChanged(boolean hasFocus) {
super.onWindowFocusChanged(hasFocus);
if (hasFocus) {
if (Build.VERSION.SDK_INT < 16) {
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
} else {
View decorView = getWindow().getDecorView();
int uiOptions = View.SYSTEM_UI_FLAG_FULLSCREEN;
decorView.setSystemUiVisibility(uiOptions);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment