2011-12-23 13 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

。非ゼロの通知コードを試してください。 .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

関連する問題