2010-11-06 27 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()代替这个。