Notification이 생성되었을 때 지정해둔 동작이 자동으로 수행됩니다.

 

알림이 오면 본 어플을 실행하도록 해서 진행중이던 Activity가 나오도록 작성하였는데

 

알림을 확인하지 않고 바로 어플이 실행됩니다.

 

이러한 동작을 막고 싶습니다.

 

아래는 코드입니다.

 

=============================================================================

                     NotificationManager nm = (NotificationManager)getSystemService(NOTIFICATION_SERVICE); 
     
                     String ticker = "이름";
                     String title = "제목";
                     String text =  "내용";
                    
                     Notification noti = new Notification(R.drawable.icon, ticker, System.currentTimeMillis());

                     Intent intentMain = new Intent(Intent.ACTION_MAIN);
                     intentMain.addCategory(Intent.CATEGORY_LAUNCHER);
                     intentMain.setComponent(new ComponentName(matching.this, matching.class));
                     PendingIntent content = PendingIntent.getActivity(matching.this, 0, intentMain, 0);

                     noti.setLatestEventInfo(matching.this, title, text, content);        //matching은 현재 액티비티입니다.
                     noti.flags |= Notification.FLAG_AUTO_CANCEL; 
                     nm.notify(1234, noti);