本文介绍了打算从我的应用程序打开通知频道设置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
打开先前在应用程序中创建的通知通道的设置需要发送什么意图?我需要它来链接我的设置活动.
What's the Intent that I need to send to open the settings of a Notification Channel that I've previously created in my app?I need it to link from my settings activity.
推荐答案
要打开单个通道的设置,可以使用 ACTION_CHANNEL_NOTIFICATION_SETTINGS
:
To open the settings for a single channel, you can use 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
会列出应用:
Using ACTION_APP_NOTIFICATION_SETTINGS
will list all channels of the app:
Intent intent = new Intent(Settings.ACTION_APP_NOTIFICATION_SETTINGS)
.putExtra(Settings.EXTRA_APP_PACKAGE, context.getPackageName());
startActivity(intent);
这篇关于打算从我的应用程序打开通知频道设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!