我正在尝试使用
Android Oreo(SDK 27)处理通知.
这是我创建NotificationChannel的代码:
NotificationManagerCompat notificationManager = NotificationManagerCompat.from(this); // .. building mChannel,the NotificationChannel instance notificationManager.createNotificationChannel(mChannel);
Android Studio告诉了这一点
Error:(67,32) error: cannot find symbol method createNotificationChannel(NotificationChannel)
我依赖于support-compat:27.0.0设置到我的core / build.gradle文件中:
compile 'com.android.support:support-compat:27.0.0'
解决方法
NotificationManagerCompat上没有createNotificationChannel()方法.您必须使用本机NotificationManager.