为什么android状态栏通知图标没有显示



当我下拉状态栏时,我可以看到我的应用程序的通知,但没有显示任何图标。我所说的图标是指像wifi图标这样的白色小图标。我已经使用安卓资产工作室来生成我正在使用的图标。这是代码:

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
String chanel_id = "3000";
CharSequence name = "Channel";
String description = "Disc";
int importance = NotificationManager.IMPORTANCE_HIGH;
NotificationChannel mChannel = new NotificationChannel(chanel_id, name, importance);
mChannel.setDescription(description);
mChannel.enableLights(true);
mChannel.setLightColor(Color.BLUE);
notificationManager.createNotificationChannel(mChannel);
Bitmap bitmap = BitmapFactory.decodeResource(gameActivity.getResources(), R.drawable.ic_kb);
mBuilder = new Notification.Builder(gameActivity, chanel_id)
.setSmallIcon(R.drawable.ic_kb)
.setLargeIcon(bitmap)
.setContentTitle(title)
.setContentText(text);
}

你打电话给notificationManager.notify(chanel_id, mBuilder.build());了吗?

最新更新