[英]Android push notification icon
通常,我会在推送通知中使用应用程序的图标。
.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());
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.