Android 通知图标仍然是默认图标,即使在更改后也是如此



这个问题简直让我感到困惑。我为我的应用程序上传了一个新图标,手机仪表板上的应用程序图标已更改。但是,通知图标仍然是相同的默认绿色浮动 android,尽管我在设置通知时声明了不同的图标 - 我也在 Android Studio 预览的行号附近看到了正确的图标,但仍然没有任何内容。

NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(context,"123")
.setSmallIcon(R.mipmap.ic_launcher_foreground)
.setLargeIcon(BitmapFactory.decodeResource(context.getResources(),
R.mipmap.ic_launcher_foreground))
.setContentTitle("Reminder: "+title)
.setContentText("Go do it TIGER!")
.setPriority(NotificationCompat.PRIORITY_HIGH)
// Set the intent that will fire when the user taps the notification
.setContentIntent(pendingIntent)
.setAutoCancel(true);

提前谢谢。

尝试使缓存失效:

安卓工作室菜单 ->文件 ->使缓存失效/重新启动

并在您的手机中卸载该应用程序

Android 会缓存通知通道设置,因此在构建器中更改通道 ID 也可以。我不知道如何使此缓存失效。

NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(context,"456")

相关内容

最新更新