Vishal Afre
Vishal Afre

Reputation: 1043

TYPE_SYSTEM_ALERT in Full screen [Without status & navigation bars]

I am using an activity in my app as TYPE_SYSTEM_ALERT (which uses SYSTEM_ALERT_WINDOW as permission). My code snippet for WindowManager is

final WindowManager.LayoutParams params = new WindowManager.LayoutParams(
            WindowManager.LayoutParams.WRAP_CONTENT,
            WindowManager.LayoutParams.WRAP_CONTENT,
            WindowManager.LayoutParams.TYPE_SYSTEM_ALERT,               
            View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
            | View.SYSTEM_UI_FLAG_FULLSCREEN,
            PixelFormat.TRANSLUCENT);

The activity is working fine as per my need except that the status bar is also visible and I want to hide that too. I tried out different flags but no luck.

Also, I tried TYPE_SYSTEM_OVERLAY but then I was not able to interact with buttons, editTexts and other widgets. And also, the status bar was visible in this TYPE_SYSTEM_OVERLAY too.

Any suggestions from Android experts here??

Upvotes: 2

Views: 1335

Answers (1)

Sanjeet A
Sanjeet A

Reputation: 5227

You cannot remove the system status bar completely after 4.0+, You can have a look on the android docs here. You can also have a look on this link to hide it permanently for the lower versions .

Upvotes: -1

Related Questions