У меня есть активность в моем приложении. Когда я выбираю один вариант, запускаю передний план моей службы с таким уведомлением:
PendingIntent pi = PendingIntent.getActivity(getApplicationContext(), 0,
new Intent(getApplicationContext(), Radio.class),
PendingIntent.FLAG_UPDATE_CURRENT);
Notification notification = new Notification();
notification.tickerText = "Connecting RadiO!.. Wait..";
notification.icon = R.drawable.ic_launcher;
notification.flags |= Notification.FLAG_ONGOING_EVENT;
notification.setLatestEventInfo(getApplicationContext(), "radiO!",
"Playing: " + songName, pi);
startForeground(1, notification);
Затем, все еще выполняя свою активность, я нажимаю на свое уведомление и открываю его, не закрывая предыдущую активность. Я не должен заниматься одной и той же деятельностью дважды.