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. Eclipse says ADT installed but no Android options appear

ADT used to work in my Eclipse, but no longer.  None of the Android
options are appearing.  No New Project>Android, no Preferences >
Android.

Eclipse is showing that ADT is installed, and it won't let me
reinstall it because it exists.  When I follow the instructions to
delete it, it goes away, but after ADT installation then Eclipse still
doesn't offer the Android options.

Is there someplace where plugin errors appear?

I don't know if it is related, but I've always had to KILL -9 the
Eclipse process after Exit.

-- 

2. Android App using SMS HTTP API to send/receive SMS

Hi,

Is there any Android application to send and receive SMS using SMS
HTTP API gateway.

For example if you buy an account with ClickaTell they will provide
you an SMS HTTP API URL to send & receive SMS.  We can configure this
in any of our application and send SMS from our application.

In the same way I am looking for any android application where I can
configure the SMS HTTP API gateway and start sending and receiving
SMS.

If it not available in the market, I planned to develop one for
Android.

Any suggestions are welcome.

Thanks & Regards
Malai

-- 

3. Consume WCF service localhost, from Android emulator

4. Concatenate two audio files

5. onTouchEvent() continuous touch causes system_server GC

6. Is this normal textview or webview?

7. EditText and auto-complete/correct