我在我的应用程序中展示通知,但是在 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)
后再试一下。 - Pankaj Kumar