我正在尝试使用Android Oreo(SDK 27)处理通知.
这是我创建NotificationChannel的代码:
NotificationManagerCompat notificationManager = NotificationManagerCompat.from(this);
// .. building mChannel, the NotificationChannel instance
notificationManager.createNotificationChannel(mChannel);
Run Code Online (Sandbox Code Playgroud)
Android Studio告诉了这一点
Error:(67, 32) error: cannot find symbol method createNotificationChannel(NotificationChannel)
Run Code Online (Sandbox Code Playgroud)
我依赖于support-compat:27.0.0设置到我的core/build.gradle文件中:
compile 'com.android.support:support-compat:27.0.0'
Run Code Online (Sandbox Code Playgroud)
Com*_*are 15
没有createNotificationChannel()方法NotificationManagerCompat.你必须使用原生NotificationManager的.
| 归档时间: |
|
| 查看次数: |
2891 次 |
| 最近记录: |