상태 표시 줄의 알림 이벤트를 클릭하여 알림을 클릭하면, 내가, 양호하게받는 액세스, 메소드를 호출 할안드로이드 : 나는 상태 표시 줄의 알림을 만들려면 다음 코드를 가지고
public void txtNotification(int id, String msg){
NotificationManager manager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
Notification notification = new Notification(android.R.drawable.sym_action_email, msg, System.currentTimeMillis());
// The PendingIntent will launch activity if the user selects this notification
Intent intent = new Intent(this, MainActivity.class)
intent.putExtra("yourpackage.notifyId", id);
PendingIntent contentIntent = PendingIntent.getActivity(this, 1, intent, 0);
notification.setLatestEventInfo(this, "title", msg, contentIntent);
manager.notify(id, notification);
}
통지의 ID. 사전에
감사합니다,
팀
(편집 : 나는 첫 번째 대답을 읽은 후 내 코드를 업데이트,하지만, 난 여전히 의도를 수신하는 방법을 모른다)
미안 내가 며칠 전에 내 대답을 업데이 트 언급 잊어 버렸습니다. 아직 궁금한 점이 있으면 알려주세요. – McStretch
아, 고마워. 거기에 몇 가지 내용을 읽었지만 대부분 객체에 대한 기술 사양이었습니다. 이 페이지는 매우 유용합니다. –