为何Android中大部分锁屏APP都要手动勾选“通知使用权”(Notification Access)?
ringa_lee
ringa_lee 2017-04-17 14:55:36
[Android讨论组]

是为了获得其他APP的通知内容从而在自己的锁屏界面上显示?
可是部分没有这功能的APP也是需要手动勾选。
如果说是为了防止APP进程被系统杀掉,那又是如何实现的?

ringa_lee
ringa_lee

ringa_lee

全部回复(3)
阿神

从官方文档看,应该是为了获得其他APP的通知内容从而在自己的锁屏界面上显示。

Lock Screen Notifications

With the release of Android 5.0 (API level 21), notifications may now appear on the lock screen. Your app can use this functionality to provide media playback controls and other common actions. Users can choose via Settings whether to display notifications on the lock screen, and you can designate whether a notification from your app is visible on the lock screen.

http://developer.android.com/guide/topics/ui/notifiers/notifications.html#lockscreenNotification

黄舟

获取通知可以不显示啊,偷偷上传啊

高洛峰

是作为系统通知层窗口来展示的,你可以去看一下WindowManager.LayoutParams的type属性。我做过一个类似的功能,是将自己的设置为TYPE_SYSTEM_ERROR这样的层级,确保自己在所有窗口的最上面。

热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 意见反馈 讲师合作 广告合作 最新更新
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习
PHP中文网抖音号
发现有趣的

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号