Я разрабатываю приложение. Я хочу отображать несколько уведомлений в области строки состояния. Но каждый раз показывает предыдущее сообщение. Я пробовал много вещей, но это не работает, как я могу отображать несколько уведомлений в строке состояния Android.
Ниже приведен мой код:
private void Notify(String Title, String Message)
{
NotificationManager notificationManager = (NotificationManager)getSystemService(NOTIFICATION_SERVICE);
@SuppressWarnings("deprecation")
Notification notification = new Notification(R.drawable.ic_launcher,Title, System.currentTimeMillis());
Log.e("NotificationManager","notify");
Intent notificationIntent = new Intent(getBaseContext(), NoteEdit.class);
notificationIntent.setFlags(Intent.FLAG_ACTIVITY_MULTIPLE_TASK);
Log.e("NotificationManager","notificationIntent");
PendingIntent pendingIntent = PendingIntent.getActivity(getBaseContext(), 0, notificationIntent, PendingIntent.FLAG_UPDATE_CURRENT);
notification.setLatestEventInfo(getBaseContext(), Title,Message, pendingIntent);
notification.defaults |= Notification.DEFAULT_SOUND;
notification.defaults |= Notification.DEFAULT_VIBRATE;
notification.defaults |= Notification.DEFAULT_LIGHTS;
notification.flags |= Notification.FLAG_ONGOING_EVENT;
notificationManager.notify(NOTIFICATION_ID , notification);
}
}
Notification
, а неNotification.Builder
? - person Estel   schedule 22.07.2014