【发布时间】:2015-01-07 10:16:01
【问题描述】:
我按如下方式创建推送通知:
NotificationCompat.Builder notificationBuilder =
new NotificationCompat.Builder(this)
.setSmallIcon(R.drawable.ic_launcher)
.setContentTitle(getString(R.string.app_name))
.setContentText(msg)
.setLights(Color.YELLOW, 250, 500)
.setAutoCancel(true)
.setVibrate(new long[] {100, 100, 100, 100})
.setSound(alarmSound)
.setPriority(NotificationCompat.PRIORITY_DEFAULT)
但是,在装有 Android 5 的 Nexus 5 上,我总是看到一个迷你图标,而不是正常大小的启动器图标。
解决方案: 对于 Android 5,似乎有必要使用带有白色图标的透明背景。在通知中心使用 LargeIcon 确实有效,但在状态栏中无效。
【问题讨论】:
标签: android google-cloud-messaging