【问题标题】:Group ID being ignored when creating NotificationChannel创建 NotificationChannel 时忽略组 ID
【发布时间】:2017-08-25 16:52:00
【问题描述】:

我正在将我的应用迁移到 Android O (API 26),创建 NotificationChannel 时通知通道组 ID 总是被忽略:

通知管理器纳米; nm.createNotificationChannelGroup(new NotificationChannelGroup("test_group", "Test")); NotificationChannel newCh = new NotificationChannel("test_channel:id123", "Test", NotificationManager.IMPORTANCE_NORMAL); newCh.setGroup("test_group"); nm.createNotificationChannel(newCh); NotificationChannel ch = nm.getNotificationChannel("test_channel:id123"); // ch.getGroup() 为空

【问题讨论】:

    标签: android android-notifications


    【解决方案1】:

    频道ID中不能使用冒号“:”,将“:”改为下划线“_”等其他字符即可。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2023-02-25
      • 2022-01-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多