Created
March 31, 2018 08:15
-
-
Save kantapp/8bf2d7fcd9706149b4bec10535067b9f to your computer and use it in GitHub Desktop.
show/hide android status bar using kotlin
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
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
setContentView(R.layout.activity_splash_screen) | |
//make Activity fullscreen /*hide Status bar*/ | |
window.setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN) | |
val button=findViewById<Button>(R.id.button) | |
button.setOnClickListener { | |
//Back Activity to normal screen /*Show Status bar*/ | |
window.clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment