【问题标题】:Default priority of notification channel on Android 8Android 8 通知通道的默认优先级
【发布时间】:2018-02-09 11:04:53
【问题描述】:

我正在将目标 SDK 版本更改为 26 并尝试使用通知渠道。我有一些通知,我想在通知栏中隐藏图标。默认情况下可以使用通知通道吗?即使我设置了频道的重要性(以及通知的优先级为 MIN),也会显示图标。然后我可以长按通知并转到我的应用程序中的通知系统设置。然后点击通知渠道,然后点击重要性,选择了“Medium”(德语“Mittel”,英文也可以称为“Default”)。这个重要性不应该是“低”吗?

这就是我设置频道的方式(使用 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);

【问题讨论】:

    标签: android android-notifications android-8.0-oreo


    【解决方案1】:

    事实证明,这不被尊重,因为我正在使用 StartForeground 启动通知。这记录在https://developer.android.com/reference/android/app/NotificationManager.html#IMPORTANCE_MIN

    【讨论】:

      猜你喜欢
      • 2018-09-23
      • 1970-01-01
      • 1970-01-01
      • 2018-07-10
      • 2015-08-05
      • 2017-11-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多