NotificationCompat with API 26

前端 未结 5 537
滥情空心
滥情空心 2020-11-27 03:38

I dont see any information about how to use NotificationCompat with Android O\'s Notification Channels

I do see a new Constructor that takes a cha

5条回答
  •  南方客
    南方客 (楼主)
    2020-11-27 03:52

    I know this answer is late, but better late then never!
    I have just released the notification-channel-compat library which provides Notification Channel support going back to OS 4.0. Since developers anyways have to design for Channels, they can now use the benefits of Channels for all devices, and they don't have to design separately for older devices.
    The library uses the built-in channel classes for OS 8.0+ devices, and mimics it for older devices. All it takes, is using our NotificationChannelCompat, NotificationChannelGroupCompat and NotificationChannelManagerHelper classes, and adding one line of code. You can see more at github. Please test it and let me know of any issues.
    Thank you,
    Lionscribe

提交回复
热议问题