Witam,

Mam skonstruowany w ten sposób service:

 
public class Notify extends Service{
    @Override
    public void onCreate() {

        //Bundle bundle = getIntent().getExtras();

        Intent resultIntent = new Intent(this, Main.class);
        PendingIntent pIntent = PendingIntent.getActivity(this, 0, resultIntent, 0);

        Uri uri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);

        Notification noti_builder = new Notification.Builder(this)
                .setSmallIcon(R.drawable.icon)
                .setContentTitle("Title")
                .setContentText("Text")
                .setSound(uri)
                .setContentIntent(pIntent)
                .build();

        NotificationManager notificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);

        noti_builder.flags |= Notification.FLAG_AUTO_CANCEL;

        notificationManager.notify(0, noti_builder);
    }

    @Override
    public IBinder onBind(Intent intent) {
        return null;
    }
}

Wywołuję go w ten sposób:

NotificationManager notificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
notificationManager.cancelAll();
Intent intent = new Intent(AddAlarm.this, Notify.class);
intent.putExtra("id", ID);
AlarmManager manager = (AlarmManager)getSystemService(Activity.ALARM_SERVICE);
PendingIntent pendingIntent = PendingIntent.getService(AddAlarm.this, 0, intent, 0);
manager.set(AlarmManager.RTC_WAKEUP, notifyDate.getTimeInMillis(), pendingIntent);

Mój problem polega na tym, że przychodzi tylko jedno powiadomienie. Kolejne przychodzi dopiero po zrestartowaniu aplikacji. Domyślam się, że to dla tego, że nadaję powiadomieniom wciąż to samo id. Jak widzicie zacząłem kombinować z putExtra() (ID to jakaś zmienna globalna), ale nie bardzo wiem jak go w service wyjąć z PendingIntentu. Czy ktoś może pomóc?