Programming/Android

Notification으로 실행중인 Activity 호출방법

위너즈 2011. 4. 25. 17:19
Notification noti = new Notification(R.drawable.icon,
						"새글이 있습니다.", System.currentTimeMillis());
				noti.defaults |= Notification.DEFAULT_VIBRATE;
				noti.flags |= Notification.FLAG_AUTO_CANCEL;

				Intent intent = new Intent(NewTalkService.this, ChatView.class);
				intent.putExtra("UserName", "1234");
				intent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT
						| Intent.FLAG_ACTIVITY_CLEAR_TOP
						| Intent.FLAG_ACTIVITY_SINGLE_TOP);				PendingIntent content =
					PendingIntent.getActivity(NewTalkService.this, 0, intent, 0);
				noti.setLatestEventInfo(NewTalkService.this,
						"새글알림", "새로운 글이 있습니다.", content);
				m_NotiManager.notify(NewTalkService.NEWNOTI, noti);