Receiving hidden status bar/entering a full screen activity event on a Service

后端 未结 1 1743
别那么骄傲
别那么骄傲 2020-12-11 07:14

I have a service that adds some views to the window manager (something like facebook\'s chat heads). This views stay on top of everything all the time, even when I\'m on the

相关标签:
1条回答
  • 2020-12-11 08:09

    Ok, if anyone is interested, I've solved my problem this way: Added a transparent view to the window manager, with 1px width and match_parent height. Then added a global layout listener to this view, and everytime there's a change on the layout, I check the position of this view on screen. If it's Y is 0, then the status bar is not visible, so a full screen app must be running. This works even better than the native View.OnSystemUiVisibilityChangeListener because it seems there are some apps that somehow don't trigger that method (like the new yahoo weather).

    0 讨论(0)
提交回复
热议问题