Notification View - Getting Values from Intent

by Siju » Thu, 01 Oct 2009 06:05:26 GMT

Sponsored Links
 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
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) {

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?


Other Threads

1. [WTB] nexian journey dan aksesorisnya

as subject, lagi nyari 1 unit nexian journey + 3 unlimited-nya dengan harga
bersahabat :)
sekalian juga cari silicon case/jelly case + screen guard untuk nexian
journey. Pls japri penawarannya, thx.


2. cara merubah boot logo android

salam kenal semuanya. . . .

bagi infonya dong, bagaimana cara merubah boot logo android. . trus
apa aja yg diperluin

thanks. .


3. how to get the GPU information of android device?

4. [Wts] htc desire hd, hd2 bnib, motorola defy, desire Z

5. OOT : WTA : Cek FU

6. Teguklah racun nimat Desire HD dan Desire

7. Mod: Spesial Akhir Tahun, Jualan 29,30,31dan1Januari 2011