I am using the following code to launch a notification when a Service is started Via AlarmManager:
nm = (NotificationManager) this.getSystemService(Context.N
As for yoshi24's comment, you may be able to set extras like this.
final Intent intent = new Intent(this, MyActivity.class);
intent.setData(data);
intent.putExtra("key", "value");
final PendingIntent contentIntent = PendingIntent.getActivity(this, 0, intent, 0);
You need to be aware of this as well before going for pending intents
https://stackoverflow.com/questions/1198558/how-to-send-parameters-from-a-notification-click-to-an-activity
UPDATE some thing like this will work for you
int your mainfest
in your activity
@Override
protected void onCreate(Bundle savedInstanceState) {
processIntent(getIntent());
}
@Override
protected void onNewIntent(Intent intent) {
processIntent(intent);
};
private void processIntent(Intent intent){
//get your extras
}