2

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??

Vishal Afre
  • 1,013
  • 3
  • 12
  • 39

1 Answers1

-1

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 .

Community
  • 1
  • 1
Sanjeet A
  • 5,171
  • 3
  • 23
  • 40
  • 3
    I know it's possible Sanjeet, coz I've seen a couple of security apps on play store which have an option to lock our device and the lock activity is on top of everything, even over the default lock screen and of course the status and navigation bars too (and that also without root to be clear). I want to design an activity just like that. – Vishal Afre Jan 25 '15 at 03:25
  • 1
    Yes, instead of TYPE_SYSTEM_ALERT, I used TYPE_SYSTEM_ERROR and it simply did the job. That activity was on top of everything and can be closed only by calling the finish() method or removing the flags – Vishal Afre Aug 11 '16 at 02:14