java.lang.NoSuchMethodError: No virtual method setChannelId(Ljava/lang/String;)Landroid/app/Notification$Builder; in class Landroid/app/Notification$Builder; or its super classes (declaration of 'android.app.Notification$Builder' appears in /system/framework/framework.jar),运行报错,请求解答!!!急急急!!!
2019-09-26
最新回答 / Ruffe
Notification.Builder builder = new Notification.Builder(this) .setAutoCancel(true) .setChannelId("test_channel_id") .setContentTitle("新消息来了") .setContentText("明天是周末...
2019-05-17
小米8 SE中需要这样写,其他手机型号未测,仅供参考!
//要在Android8.0版本中设置setChannelId
builder.setChannelId("channel_id");
//要在Android8.0版本中设置setChannelId
builder.setChannelId("channel_id");
2019-01-04
最新回答 / 精慕门9177950
// 加上这个方法 private NotificationManager getManager(){ if (manager == null){ manager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); } return manager; }
2018-11-14