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
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?

--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. Building app outside android source tree

I'd like to have a separate android project outside the android source
tree for my application but would like to be included as part of the
android platform build. The idea is to replace the built-in contacts
app with my custom contacts application which is outside the android
src tree.

When I try to build my app outside using the "mm" function, it gives
this error

"Couldn't locate the top of the tree.  Try setting TOP."

Anyway to fix this issue? or any other suggestions on how to build
application outside the android src tree (I dont want to use eclipse
though) ?

Thanks,
Sandy

-- 
unsubscribe: android-porting+unsubscr...@googlegroups.com
website: 

2. Overclock milestone ke 1200 Mhz

Sori gan...just fyi buat yang belom tau nih


http://code.google.com/p/milestone-overclock/

ga usah flash rom..pake rom standard..langsung set ke 1200 mhz..

trus running setcpu...jadi deh

-- 
"Indonesian Android Community [id-android]" 

3. Fwd: [WTA] Desire Virgin

4. (JUAL RUGI) Perdana XL Internet Unlimited 150rb/bulan brand new

5. rooting eris

6. Android Camera Flash in 1.5 and 1.6 Please Help

7. Even with Min SDK version, building app against 2.2 breaks 1.5?