Created
March 19, 2018 21:42
-
-
Save hatamiarash7/d55fa1eba52116fa63899a1a6f57e727 to your computer and use it in GitHub Desktop.
Android - Hide statusbar
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void hideStatusbar(Activity context) { | |
if (Build.VERSION.SDK_INT < 16) { | |
context.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); | |
} else { | |
View decorView = context.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