为了账号安全,请及时绑定邮箱和手机立即绑定

实际写的时候报错

 报如下错误:No Channel found for pkg=com.example.mynotification, channelId=通知渠道ID, id=1, tag=null, opPkg=com.example.mynotification, callingUid=10085, userId=0, incomingUserId=0, notificationUid=10085, notification=Notification(channel=通知渠道ID pri=0 contentView=null vibrate=null sound=null defaults=0x0 flags=0x10 color=0x00000000 vis=PRIVATE)

尝试了网上的解决办法,依然报错

正在回答

2 回答

builder = new Notification.Builder(this);
builder.setAutoCancel(true)
    .setChannelId("channel_id")
    .setContentTitle("下载中。。。。。")
    .setContentText("明天是周日,不上班")
    .setSmallIcon(R.mipmap.ic_launcher);

builder 写全试试

0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消
Android O(8.0)通知栏解决方案
  • 参与学习       6646    人
  • 解答问题       4    个

本课程主要介绍Android 8.0 ChannelNotification的管理。

进入课程

实际写的时候报错

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信