2011-12-23 3 views
1

내 프로젝트에서 C2DM 코드를 사용하여 푸시 알림을 구현했습니다. 그것은 푸시 알림을 표시하지만 내 문제는 푸시 알림을 클릭하면 응용 프로그램을 여는 방법입니다.android : 푸시 알림을 클릭하면 앱을 여는 방법

내가 좋아하는 그 일을하고있다 :

Intent intent = new Intent(context, BingoDiaryActivity.class); 
     intent.putExtra("registration_id", registrationId); 
     PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, intent, 0); 
     notification.setLatestEventInfo(context, "Registration", "Successfully registered", 
       pendingIntent); 
     notificationManager.notify(0, notification); 

그러나

수있는 사람이 날이 이상 할 수

작동하지 않습니다?

감사

+1

. 0이 아닌 알림 코드를 사용해보십시오. .notify (99, 알림) –

답변

1

내가 코드를 잘못,하지만 내 프로젝트에서이 작동하는 것을 이해할 수 없다 - 그리고 클릭하면 알리미 내 응용 프로그램을 열 : 그냥 직감에

n.setLatestEventInfo(context, "text", "text", 
     PendingIntent.getActivity(
       context, 
       0, 
       context.getPackageManager().getLaunchIntentForPackage(context.getPackageName()) 
         .putExtra("extra_name", extra), 
       0)); 
+0

지금 내게 문제가 될 수있는 말을 할 수 있습니까? – ekjyot

+0

수정 된 답변보기 – Jin35

관련 문제