通常,我在我的推送通知中使用我的應用程序圖標。Android推送通知圖標
.setSmallIcon(applicationContext.getApplicationInfo().icon)
如何在不同的推送通知中使用不同的自定義圖標(我自己創建的)?
通常,我在我的推送通知中使用我的應用程序圖標。Android推送通知圖標
.setSmallIcon(applicationContext.getApplicationInfo().icon)
如何在不同的推送通知中使用不同的自定義圖標(我自己創建的)?
NotificationCompat.Builder builder = new NotificationCompat.Builder(context)
.setContentTitle(notificationTitle)
.setContentText(notificationMessage)
.setSmallIcon(R.drawable.YOUR_IMAGE)
.setContentIntent(resultPendingIntent)
.setAutoCancel(true)
.setStyle(bigStyle);
NotificationManager notificationmanager = (NotificationManager)context.getSystemService(context.NOTIFICATION_SERVICE);
notificationmanager.notify(nofy_id, builder.build());
謝謝,但我該如何將我的圖標放在可繪製名稱空間中? –
只需將您的圖標添加到可繪製的文件夾中即可 – theremin
我怎麼把我的圖標繪製的命名空間? –