안드로이드 개발 질문/답변
(글 수 45,052)
notification 에 pending intent 를 써서 notification 눌렀을 때 특정 activity를 띄우려고 합니다.
여기까지는 아래처럼 작성해서 성공했습니다.
Notification noti = new Notification(R.drawable.stat_sys_download_anim5, fileTitle, System.currentTimeMillis());
noti.flags = Notification.FLAG_AUTO_CANCEL;
Intent clickIntent = new Intent(Intent.ACTION_MAIN);
clickIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK
| Intent.FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY
| Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT);
clickIntent.addCategory(Intent.CATEGORY_LAUNCHER);
clickIntent.setComponent(new ComponentName("aaa", "bbb"));
noti.contentIntent = PendingIntent.getActivity(getApplicationContext(), 0, clickIntent, 0);
noti.contentIntent = PendingIntent.getActivity(getApplicationContext(), 0, clickIntent, 0);
문제는 특정 activity가 이미 살아있을 때만 그 activity를 띄우고
실행되지 않았거나 종료된 상태일 때는 그냥 notification 에서 내용만 살아지고 activity는 안 뜨도록 하고 싶습니다.
intent에 flag 설정을 이리저리 바꿔봐도 죽어있는 activity가 실행이 되네요ㅠㅠ
방법 아시는 분 답변 부탁 드립니다!



