繁体   English   中英

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

[英]Why is android status bar notification icon not showing up?

当我下拉状态栏时,我可以看到我的应用程序的通知,但没有显示图标。 我所说的图标是指像 wifi 图标这样的白色小图标。 我使用Android Asset Studio生成了我正在使用的图标。 这是代码:

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()); ?

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM