【发布时间】:2013-09-19 00:26:45
【问题描述】:
我有以下显示通知的方法:
private void sendNotification(String msg) {
mNotificationManager = (NotificationManager)
_context.getSystemService(Context.NOTIFICATION_SERVICE);
Notification notification = new Notification(R.drawable.menu_cartable,
"you have a new message",
System.currentTimeMillis());
notification.flags = Notification.FLAG_AUTO_CANCEL;
notification.sound = RingtoneManager
.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
Intent notificationIntent = new Intent(_context, ActCartable.class);
PendingIntent intent = PendingIntent.getActivity(_context, 0,
notificationIntent, PendingIntent.FLAG_CANCEL_CURRENT);
notification.setLatestEventInfo(_context,
"you have a new message",
msg,
intent);
mNotificationManager.notify(NOTIFICATION_ID, notification);
}
在 Android 4.2 中,当第一次收到消息时(通知栏被清除),通知栏中会显示一个大图标(tickerText),几秒钟后它会被隐藏并通知转到通知栏。如果我没有打开该通知(通知栏未清除)并收到第二条消息,则不会再次显示 大图标,但设备会正确发出声音并更新新消息的内容如果用户打开通知栏,则在通知栏中成功。
您应该知道 大图标 在 android 3.x 中一直显示。
如何在 android 4.x 中每次收到新消息且通知栏未清除时显示该大图标?
【问题讨论】:
标签: android notifications