Reputation: 645
I am able to hide notification bar using this code
setWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
But I want the user to have an option to show and hide notification bar.
Currently my Activity
permanently hides the notification bar.
How cam I do it?
Upvotes: 0
Views: 2420
Reputation: 18460
You can exit full screen mode (i.e. show status bar) by using:
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
getWindow().addFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
Upvotes: 1