Drawing over other applications in Android [closed

2020-06-03 06:47发布

There is an interesting application called Twilight which appears to simply draw over all applications with a reddish filter to remove blue light during nighttime hours (presumably to help sleep).

I'm interested in doing something similar, but not necessarily for sleep purposes. I'd like to draw text or a watermark over everything on the phone. How can I do this (draw an Activity or something like it over everything) in Android?

1条回答
啃猪蹄的小仙女
2楼-- · 2020-06-03 07:46

You should look at Android System Overlay which pretty much draws a view on the root on Android Window Manager.

See: Creating a system overlay window (always on top)

You need "android.permission.SYSTEM_ALERT_WINDOW" permission in your manifest.

See: http://developer.android.com/reference/android/Manifest.permission.html#SYSTEM_ALERT_WINDOW

You might also like to look at Window manger

查看更多
登录 后发表回答