【发布时间】:2016-01-13 05:09:22
【问题描述】:
我使用NotificationCompat 创建了一个简单的通知。
以下是我的代码
NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(mContext);
mBuilder.setSmallIcon(icon)
.setTicker(title)
.setWhen(0)
.setAutoCancel(true)
.setContentTitle(title)
.setStyle(new NotificationCompat.InboxStyle())
.setContentIntent(resultPendingIntent)
.setSound(RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION))
.setContentText(message);
NotificationManager notificationManager = (NotificationManager) mContext.getSystemService(Context.NOTIFICATION_SERVICE);
notificationManager.notify(mNotificationId, mBuilder.build());
这是我设备上的输出。
我的图标没有蓝色渐变背景。该图标是一个仅包含白色 USB 符号的 png。
我怀疑背景是由系统添加的。
现在我的问题是,如何防止这种修改。
我的设备正在运行 KitKat 4.4.4
【问题讨论】:
标签: android notifications android-notifications notification-icons