0

如果我使用in的mipmap图标,当通知它时,系统 ui 将崩溃。但它在 O 下工作,如果我在目录中用 res 更改图标,它也可以工作。虽然 Google 告诉我们应该将应用程序图标放在dirs 中,但为什么我不能将其用作Android O 中的图标?smallIconNotificationAndroid Odrawablemipmapnotification

NotificationCompat.Builder notificationBuilder =
            new NotificationCompat.Builder(this, channelId)
                .setSmallIcon(R.mipmap.ic_launcher)
                .setContentTitle(notification.getTitle())
                .setContentText(notification.getBody())
                .setAutoCancel(true)
                .setDefaults(Notification.DEFAULT_ALL)
                .setContentIntent(pendingIntent);
4

0 回答 0