[英]How can i check lock screen notifcation is enabled or not programmatically
I want to check that user has enabled lock screen notifications or not.我想检查用户是否启用了锁屏通知。 Settings -> Notifications -> Lock Screen Notifications
设置 -> 通知 -> 锁屏通知
But I am not able to find any code regarding this.但我找不到任何关于此的代码。
fun getLockscreenNotificationsEnabled(context: Context) =
android.provider.Settings.Secure.getInt(
context.contentResolver,
"lock_screen_show_notifications", 0
) != 0
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.