【发布时间】:2015-11-25 10:24:52
【问题描述】:
我正在制作应用程序,我从Parse 获取数据并将该数据传输到通知以生成并显示给用户。
但由于某种原因,我无法在棉花糖中显示正确的彩色图标
在其他所有 Android 版本中,它都运行良好,但在 Marshmallow 中,它令人毛骨悚然的白色图标不是我选择的实际。
这是我的通知代码。
Intent cIntent = new Intent(context, MainActivity.class);
PendingIntent pendingIntent = PendingIntent.getActivity(context, 0,
cIntent, PendingIntent.FLAG_UPDATE_CURRENT);
NotificationCompat.Builder builder = new NotificationCompat.Builder(context)
.setSmallIcon(R.drawable.ic_launcher)
.setContentText(data)
.setContentTitle("Notification from Parse")
.setContentIntent(pendingIntent);
Notification notification = builder.build();
NotificationManager nm = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
nm.notify(100, notification);
请帮我解决这个问题,或者告诉我任何其他方法可以解决这个问题。
【问题讨论】:
标签: android parse-platform notifications push-notification