我想檢查用戶是否啟用了鎖屏通知。設定 -> 通知 -> 鎖屏通知
但我找不到任何關于此的代碼。
uj5u.com熱心網友回復:
試試這個:
fun getLockscreenNotificationsEnabled(context: Context) =
android.provider.Settings.Secure.getInt(
context.contentResolver,
"lock_screen_show_notifications", 0
) != 0
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/405918.html
標籤:
上一篇:高分不會保存
下一篇:從流中寫入wav檔案沒有音頻資料
