Drawing over other applications in Android [closed]

本小妞迷上赌 提交于 2019-12-09 05:37:44

问题


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:


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



来源:https://stackoverflow.com/questions/22260537/drawing-over-other-applications-in-android

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!