Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/227.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
为什么android状态栏通知图标没有显示?_Android_Libgdx - Fatal编程技术网

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

为什么android状态栏通知图标没有显示?,android,libgdx,Android,Libgdx,当我拉下状态栏时,我可以看到我的应用程序的通知,但没有显示任何图标。 我所说的图标是指像wifi图标这样的白色小图标。我曾经生成我正在使用的图标。代码如下: if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { String chanel_id = "3000"; CharSequence name = "Channel"; String descr

当我拉下状态栏时,我可以看到我的应用程序的通知,但没有显示任何图标。 我所说的图标是指像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())

是的,我有。通知显示得很好,大图标也可以工作,只有小的白色图标不显示。嗨@LonelyBishop,你找到解决方法了吗?嗨。不,很遗憾,你修好了吗?我在这里也吃同样的!不,不幸的是我不能。