2012-07-08 61 views
2

我正在開發PhoneGap/Cordova應用程序,我使用此插件成功添加LocalNotifications:https://github.com/phonegap/phonegap-plugins/tree/master/Android/LocalNotification;然而,我遇到一個小問題,當我點擊通知窗口中的通知時,我的應用程序未打開,我的意思是什麼都沒有發生,有人可以向我解釋如何當有人點擊我的應用程序通知時打開它?如何使用PhoneGap中LocalNotifications插件的通知打開應用程序

謝謝!

回答

0

我已經找到了答案,在AlarmReceiver.class看看與行:

PendingIntent.getActivity(背景下,0,新的意向(),0);

替換爲:

意圖notificationIntent =新意圖(上下文,YourApp.class); final PendingIntent contentIntent = PendingIntent.getActivity(context,0,notificationIntent,0);

其中YourApp.class是您要打開的類

相關問題