相关疑难解决方法(0)

如何检查我的应用是否允许显示通知

在Android设置中,如果用户不愿意,可以关闭通知.那么有什么方法isNotificationAllowed()可以检查我的应用是否允许显示通知?以及如何打开android设置页面来引导我的用户打开通知?

notifications android android-notifications

28
推荐指数
3
解决办法
2万
查看次数

使用NotificationListenerService检查对通知的访问

我正在使用> = 4.3 NotificationListenerService来访问通知.在第一次启动时,我的应用程序将用户带到"访问通知"系统面板,但是只要禁用"访问通知"中我的应用程序的复选框,我就会将用户带到那里.我没有在isNotificationAccessEnabled()任何地方找到一个方法,但我肯定知道这是可能的,因为像Krome这样的应用程序也是这样做的.

notifications android

24
推荐指数
2
解决办法
2万
查看次数

通过代码访问Android 4.3中的新通知设置

我如何通过代码访问它?所以我可以自动为用户打开它,他们不必通过安全设置来启用它.

我无法在Android Studio中找到它startActivity(new Intent(Settings.<>));,其中<>是设置屏幕列表.

通知访问屏幕

图片由Android Police提供

notifications android

8
推荐指数
1
解决办法
9414
查看次数

Android 7.0 / API24:如何检查通知访问权限(Settings.Secure.enabled_notification_listeners)

在Android 6.0 / API23和更早版本中,以下功能可以正常工作:

String settingEnabled = android.provider.Settings.Secure.getString(this.getContentResolver(), "enabled_notification_listeners");
Run Code Online (Sandbox Code Playgroud)

在Android 7.0 Nougat / API24中,似乎不再受支持,因为上面的代码返回null

它实际上从未在这里提及:https : //developer.android.com/reference/android/provider/Settings.Secure.html

我们如何检查我们的应用程序是否在Android 7.0 Nougat API24中具有通知访问权限?

编辑:看来,实际上,在您首次在设置中获得访问权限后,以上代码返回了正确的状态。但安装后未按最初要求。

android android-notifications android-7.0-nougat

0
推荐指数
1
解决办法
1303
查看次数