I have a Notification in my application and a view attached to see the
notification. In my view I want to get the values that I put using
putExtras method. I want to use this value to display the details to
the user about the notification.
I used following
Intent intent= new Intent(context, MyNotificationView.class);
intent.putExtra("MYKEY", "VALUE");
and attached this intent in the PendingIntent as given below:
PendingIntent contentIntent = PendingIntent.getActivity
(context, 0,
intent, 0);
In my NotificationView, I tried to get the value from the intent as
follows:
String ts = getIntent().getStringExtra("MYKEY");
This gives the correct value the first time, but with subsequent
notifications, it gives the same value as what is put before. This I
can understand from documentation that I need to use the onNewIntent()
call back to set my new intent so that getIntent() can get the updated
intent, I have following:
protected void onNewIntent(Intent intent) {
super.onNewIntent(intent);
setIntent(intent);
}
But that is not solving my problem, I am not seeing a callback for
onNewIntent() method and I am still getting the first intent.
Can someone tell me what I am doing wrong?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---