android - Intent 从我的应用程序打开通知 channel 设置

标签 android android-notifications android-8.0-oreo notification-channel

我需要发送什么 Intent 来打开我之前在我的应用程序中创建的通知 channel 的设置? 我需要它来链接我的设置 Activity 。

最佳答案

要打开单个 channel 的设置,您可以使用ACTION_CHANNEL_NOTIFICATION_SETTINGS :

Intent intent = new Intent(Settings.ACTION_CHANNEL_NOTIFICATION_SETTINGS)
        .putExtra(Settings.EXTRA_APP_PACKAGE, context.getPackageName())
        .putExtra(Settings.EXTRA_CHANNEL_ID, yourChannelId);
startActivity(intent);

使用 ACTION_APP_NOTIFICATION_SETTINGS将列出应用程序的所有 channel :

Intent intent = new Intent(Settings.ACTION_APP_NOTIFICATION_SETTINGS)
        .putExtra(Settings.EXTRA_APP_PACKAGE, context.getPackageName());
startActivity(intent);

关于android - Intent 从我的应用程序打开通知 channel 设置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48853948/

相关文章:

android - 在 Oreo 中注册静态广播接收器

android - 具有拉伸(stretch)复合可绘制对象的固定宽度 TextView

android - Kivy:AsyncImage 和 Urllib 不会在 Android 上打开任何 url

Android 将我的应用程序 Intent 添加到 edittext 菜单选项

Android:是否可以获取其他应用的通知信息?

android - 穿戴设备和移动设备的不同文本

android - 错误通知 : The given region must intersect with the Bitmap's dimensions

java - 如何在没有 root 的情况下可靠地模拟 Android 上的触摸事件(如 Automate 和 Tasker)?

android - 在 WebResourceResponse 中获取 webWiev.getUrl() 的值 shouldInterceptRequest(WebView view, String url)

android - Android Oreo 的后台位置更新在 2 小时后停止