Android app that runs on top of ALL other apps?

前端 未结 3 2068
既然无缘
既然无缘 2021-01-31 21:59

Before today I would have said this is just not possible, to have an app that runs overlayed on top of everything else: home screens, apps, dialer, etc.

If you try the f

3条回答
  •  旧巷少年郎
    2021-01-31 22:10

    Starting from Android 4.x, Android team Android team fixed a potential security problem by adding a new function adjustWindowParamsLw() in which it will add FLAG_NOT_FOCUSABLE, FLAG_NOT_TOUCHABLE and remove FLAG_WATCH_OUTSIDE_TOUCH flags for TYPE_SYSTEM_OVERLAY window.

    That's TYPE_SYSTEM_OVERLAY window won't receive any touch event on ICS platform and, of course, to use TYPE_SYSTEM_OVERLAY is not workable on ICS or future devices.

    Updated: 2016/5/4 TYPE_TOAST cannot receive touch events on Android 4.0~4.3. It's the same as TYPE_SYSTEM_OVERLAY. On Android 4.4+, TYPE_TOAST removed from the excluded list, so you can also use TYPE_TOAST to receive touch events on Android 4.4+ devices.

提交回复
热议问题