【发布时间】:2015-02-22 09:22:26
【问题描述】:
我在我的应用程序中显示通知 - 但由于某种原因在 android 版本 Lolipop 上它在大图标旁边显示一个灰色圆圈,如下所示:
有人知道为什么会这样吗?
这是我创建通知的代码:
builder = new NotificationCompat.Builder(context)
// Set Icon
.setSmallIcon(R.drawable.ic_launcher)
.setLargeIcon(icon)
// Set Ticker Message
.setTicker(message)
// Set Title
.setContentTitle(message)
// Set Text
.setContentText(context.getString(R.string.app_name))
// Add an Action Button below Notification
// .addAction(R.drawable.share,
// context.getString(R.string.share), pendingShare)
// Set PendingIntent into Notification
.setContentIntent(contentIntent)
// Dismiss Notification
.setAutoCancel(true)
.setSound(
Uri.parse("android.resource://"
+ context.getPackageName()
+ "/"
+ prefs.getInt(Constants.NOTIF_SOUND,
R.raw.al_affassi_full)));
【问题讨论】:
-
我认为这是你设置的小图标。评论后尝试
setSmallIcon(R.drawable.ic_launcher) -
@PankajKumar 这样通知会发出声音,但不会显示通知。
标签: android android-notifications android-notification-bar android-icons