NotificationManager nm = (NotificationManager)context.getSystemService(Context.NOTIFICATION_SERVICE);
PendingIntent intent = PendingIntent.getActivity(context, 0, new Intent(context, main.class), 0);
Notification notification = new Notification(R.drawable.main_icon, "취업스터디", System.currentTimeMillis());
notification.defaults |= (Notification.DEFAULT_SOUND | Notification.DEFAULT_VIBRATE);
notification.setLatestEventInfo(context, "title","msg", intent);
nm.notify(1, notification);
위와같이 NotificationManager 를이용하여 알림을 등록할수있습니다.
그리고
NotificationManager NM = (NotificationManager)
getSystemService(NOTIFICATION_SERVICE);
NM.cancel(1);
위와같은방법으로어플에 진입했을때 알림이온표시를 없앨수있습니다.
제가궁금한건 알림이오고 그걸눌러서 어플에 들어올경우 제가보낸 title나 msg를 알수있는 방법이혹시 있는지 궁금합니다.




PendingIntent 객채 만들 때 intent 넣쟎아요.
그 intent 에 intent.putExtra 로 넣고 싶은 데이터를 넣습니다.
상태바 펼쳐서 해당 알림 눌렀을 때 실행되는 Activity 의 onCreate 에서
Bundle b = getIntent().getExtras();
b.getXXX 로 넣었던 데이터를 얻을 수 있습니다.