I have an app that switches between full screen and normal screen for a certain condition.
I have successfully done this with the notification but the TITLE BAR still remains hidden after I set it back from full screen to normal screen mode. So HOW DO I SHOW THE TITLE BAR AFTER HIDING IT?
EDIT:
I have come across answers where they make a custom title bar and switch between its visibility but thats not what I want.
CODE:
if(ScreenReceiver.wasScreenOn) {
Toast toast=Toast.makeText(this, "screen was on", Toast.LENGTH_LONG);
toast.show();
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
getWindow().addFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
setContentView(R.layout.resume);
} else {
Toast toast=Toast.makeText(this, "screen was off", Toast.LENGTH_LONG);
toast.show();
getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
setContentView(R.layout.main);
}
try this