1

I want my app to display a permanently visible view (like the status bar) no matter which app the user is in, except full-screen apps such as games.

So far my app starts a service, which inflates a view and adds it to the WindowManager as a TYPE_SYSTEM_OVERLAY, as described here.

The issue I am having is that when I launch a full-screen app (the gallery, Angry Birds, etc), my overlay is still there. How can I detect when a full screen app is launched or when the status bar has been hidden so I can remove it?

Community
  • 1
  • 1
Martin
  • 334
  • 2
  • 4
  • 13

2 Answers2

1

This isn't supported for third party apps, sorry.

hackbod
  • 90,665
  • 16
  • 140
  • 154
  • I can't find anything in the public APIs, but it's definitely doable. There is an app called "StatusBar+" which exhibits this exact behaviour without root. – Martin Mar 02 '12 at 08:09
1

In your service, create a timer that constantly measures the height of the view that it inflates. If the height of the view increases by 25dip, it probably means the status bar disappeared and the phone is now in full screen mode. If this happens, you can set the visibility of the overlay view to GONE.

Obviously polling the view height is a hack, but it may be the only way.

Edward Kim
  • 11
  • 1