为什么通知中缺少应用名称?
这是通知在具有API级别16的AVD上的外观:
这里是API级别28(隐藏的应用名称):
代码:
mBuilder = new NotificationCompat.Builder(mContext, Constants.CHANNEL_ID_TRANSFER_PROGRESS)
.setSmallIcon(R.drawable.icon_import_export)
.setContentText("Import successful")
.setPriority(NotificationCompat.PRIORITY_LOW)
.setCategory(NotificationCompat.CATEGORY_SERVICE)
.setVisibility(NotificationCompat.VISIBILITY_PUBLIC);
mNotificationManager = NotificationManagerCompat.from(mContext);
mNotificationManager.notify(Constants.NOTIFICATION_ID_TRANSFER_PROGRESS, mBuilder.build());