I have a problem, which my app sends for example
2 notifications at the same time
of two classes that extend a service, but only keeps the last notification, does not accumulate to see both, I want to accumulate all notifications in the bar and that the user must remove.
The first class that extends a service
@Override
public void onDestroy() {
Log.e(TAG2, "Timer cancelado");
super.onDestroy();
int icono = R.mipmap.ic_launcher;
NotificationCompat.Builder mBuilder;
NotificationManager mNotifyMgr =(NotificationManager) getApplicationContext().getSystemService(NOTIFICATION_SERVICE);
Intent i=new Intent(ServicioTimer2.this, tiempo_carro2.class);
PendingIntent pendingIntent = PendingIntent.getActivity(ServicioTimer2.this, 0, i, 0);
mBuilder =new NotificationCompat.Builder(getApplicationContext())
.setContentIntent(pendingIntent)
.setSmallIcon(icono)
.setContentTitle("Carro 2")
.setContentText("Tiempo de carro 2 terminado!")
.setVibrate(new long[] {100, 250, 100, 500})
.setAutoCancel(false);
mNotifyMgr.notify(1, mBuilder.build());
}
The second class is the same previous code, they only change the message.