Home > Net >  How can i check lock screen notifcation is enabled or not programmatically
How can i check lock screen notifcation is enabled or not programmatically

Time:01-05

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.

CodePudding user response:

Try this:

fun getLockscreenNotificationsEnabled(context: Context) =
    android.provider.Settings.Secure.getInt(
        context.contentResolver,
        "lock_screen_show_notifications", 0
    ) != 0
  •  Tags:  
  • Related