【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>>
```
notification = new Notification.Builder(this) .setContentTitle(mMusicModel.getName()) .setContentText(mMusicModel.getAuthor()) .setSmallIcon(R.mipmap.logo) .setContentIntent(pendingIntent) .build();
```
主要是因为8.0后notification加上了channel,所以应该写成这样
```
notification = new NotificationCompat.Builder(this, CHANNEL_ID) .setContentTitle(mMusicModel.getName()) .setContentText(mMusicModel.getAuthor()) .setSmallIcon(R.mipmap.logo) .setContentIntent(pendingIntent) .build();
```
参考:https://blog.csdn.net/qq_34262794/article/details/78851134
来源:oschina
链接:https://my.oschina.net/jenqz/blog/3147930