2012-08-11 5 views
0
내가 통지의 클릭에 대화 상자를 엽니 다하려고

의 클릭에 개방하지 않고이 작업을 수행 할 수 없습니다 :대화 상자가 통지

여기

내 코드 것은 :

Intent in = new Intent(context, SnoozeEvent.class); 
    in.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); 
    PendingIntent Sender = PendingIntent.getBroadcast(context, 0, intent, 0); 
    manager = (NotificationManager)context.getSystemService(Context.NOTIFICATION_SERVICE); 
    notification = new Notification(R.drawable.icon, "Wake up alarm", System.currentTimeMillis()); 
    notification.setLatestEventInfo(context, "Hanuman Chalisa", "Wake Up...", Sender); 
    manager.notify(1, notification); 

답변

1

오류는 당신이 지점이다 PendingIntent는 존재하지 않는 인 텐트 ("인 텐트"라는 인 텐트를 가리 킵니다 - "인"이라는 인 텐트를 만들었습니다). (당신이 만든 의도를 가리 키도록)이 함께

PendingIntent Sender = PendingIntent.getBroadcast(context, 0, intent, 0); 

:

다음 줄을 교체

PendingIntent Sender = PendingIntent.getBroadcast(context, 0, in, 0); 

당신이 그렇게한다면, 모든 것이 잘 작동합니다.

+0

내가 바보 같은 실수를 한 덕분에 ............ – Nitish