我正在将目标 SDK 版本更改为 26 并尝试使用通知 channel 。我有一些通知,我想将其图标隐藏在通知栏中。默认情况下可以使用通知 channel 吗?即使我设置 channel 的重要性(以及通知的优先级为 MIN),该图标也会显示。然后我可以长按通知并转到我的应用程序中通知的系统设置。然后点击通知 channel ,然后点击重要性,其中选择了“Medium”(德语“Mittel”,英文也可以称为“Default”)。这个重要性不应该是“低”吗?
这是我设置 channel 的方式(使用 Android 的 Mono):
string name = GetString(Resource.String.DbQuicklockedChannel_name);
string desc = GetString(Resource.String.DbQuicklockedChannel_desc);
NotificationChannel mChannel =
new NotificationChannel(NotificationChannelIdQuicklocked, name, NotificationImportance.Min);
mChannel.Description = desc;
mChannel.EnableLights(false);
mChannel.EnableVibration(false);
mNotificationManager.CreateNotificationChannel(mChannel);
最佳答案
事实证明,这并没有得到尊重,因为我是用 StartForeground 开始通知的。这记录在 https://developer.android.com/reference/android/app/NotificationManager.html#IMPORTANCE_MIN 上.
关于android - Android 8 上通知 channel 的默认优先级,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48704448/