Android Notifications
Im trying to start a new activity once i press a notification...the related code is:
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);
But the activity just dsnt begin..the 开发者_运维技巧notification pops up..but if i click it nothin happens...plz advice!!!
Pardon the obvious question but is DatabaseActivity referenced in your manifest?
May be you can use getApplicationContext() instead of this in the pendingIntent definition.
精彩评论