2010-11-06 83 views
1

我試着去開始新的活動一次我按下的通知...相關的代碼是:Android通知

NotificationManager notifManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE); 

Notification note = new Notification(R.drawable.android, "New E-mail", System.currentTimeMillis()); 

PendingIntent intent = PendingIntent.getActivity(this, 0, new Intent(this, DatabaseActivity.class), 0); 

note.setLatestEventInfo(this, "New E-mail", "You have one unread message.", intent); 

notifManager.notify(NOTIF_ID, note); 

但活動只是dsnt begin..the通知彈出up..but如果我點擊它沒有發生...... PLZ的意見!

+0

你在DDMS上看到什麼? – Jonas 2010-11-06 09:21:46

+0

ddms運行正常...沒有錯誤沒有沒有... – Skandha 2010-11-06 10:15:13

回答

1

請原諒明顯的問題,但在您的清單中引用了DatabaseActivity?

+0

是的,它是....使用它的其他幾個地方...所以我想它必須在那裏... – Skandha 2010-11-06 10:14:34

+0

也ive試圖刪除通知使用flag_auto _cancel ...即使dsnt工作...是兩個相關或..... – Skandha 2010-11-06 10:33:52

0

也許你可以在pendingIntent定義中使用getApplicationContext()代替這個。