问答详情
源自:2-1 channelApi的介绍

实际写的时候报错

 报如下错误: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)

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

提问者:慕数据9115892 2018-08-03 13:50

个回答

  • 三少爷的鞋
    2018-08-11 21:50:11

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

    builder 写全试试