nm = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
Intent myIntent = new Intent(getApplicationContext(), WeatherNotificationMessage.class);
myIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK
| Intent.FLAG_ACTIVITY_CLEAR_TOP
| Intent.FLAG_ACTIVITY_SINGLE_TOP);
PendingIntent intent = PendingIntent.getActivity(
getApplication(), 0, myIntent, 0);
String ticker = "ticker";
String title = "title";
String text = "text";
// Create Notification Object
Notification notification =
new Notification(android.R.drawable.ic_dialog_alert,
ticker, System.currentTimeMillis());
//notification.icon = R.mipmap.gdgd;
notification.setLatestEventInfo(getApplication(),
title, text, intent);
nm.notify(0001, notification);
상단바 알림이오면 상단바를 누르면 activity가 실행되는데
기존에 액티비티가 실행중이면 그위에 또 액티비티가 나와서 중첩되네요....
이 현상을 해제하려고 검색해봐서 인텐트에 플래그를 보내주면 된다고해서 넣어봤는데 아무리 해도 안되네요 ㅠㅠ
제가 빠드린게 있을까요?
위 코드가 Notification 알람부분 코드입니다.