public static final int NOTIFY_FAILED = 1;
private final Notification displayErrorNotification = new Notification(R.drawable.notification, "Communication Error", System.currentTimeMillis());
private void displayNotificationError(String message) {
PendingIntent contentIntent = PendingIntent.getActivity(this, 0, new Intent(), 0);
displayErrorNotification.number++;
displayErrorNotification.setLatestEventInfo(getApplicationContext(), "Failed x ("+displayErrorNotification.number+")", message, contentIntent);
notificationManager.notify(NOTIFY_FAILED, displayErrorNotification);
}
Dans cet exemple, j'ai utilisé 1 pour les notifications échouées, mais que se passe-t-il si d'autres programmes utilisent également le numéro 1 pour leurs notifications.Quels numéros d'identification utiliser pour les notifications
Que se passerait-il quand je fais ceci:
notificationManager.cancel(NOTIFY_FAILED);