Cannot find method createNotificationChannel(NotificationChannel)

后端 未结 1 677
暗喜
暗喜 2021-01-12 06:13

I\'m trying to handle notification with Android Oreo (SDK 27).

Here is my code creating the NotificationChannel:

NotificationManagerCompat notificati         


        
相关标签:
1条回答
  • 2021-01-12 07:10

    There is no createNotificationChannel() method on NotificationManagerCompat. You have to use the native NotificationManager for that.

    UPDATE 2019-07-29: As Onkar Nene points out, they finally added createNotificationChannel() on NotificationManagerCompat. Use androidx.appcompat:appcompat:1.1.0-rc01 or newer.

    0 讨论(0)
提交回复
热议问题