내 앱에서 활동이 있습니다. 내가 하나의 옵션을 클릭하면,이 같은 통지 내 서비스의 전경을 실행 시작 :알림 대기 중 알림 전경 서비스 android
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);
을 그리고, 여전히 내 활동을 실행, 내 알림을 클릭하고 나는 이전의 활동을 닫지 않고 그것을 열었다. 나는 같은 활동을 두 번해서는 안된다.
http://developer.android.com/guide/topics/ui/notifiers/notifications.html#NotificationResponse – CommonsWare