problem with Notification (PendingIntent)

by Sgom » Fri, 31 Oct 2008 02:43:14 GMT

Sponsored Links
 Hello guys!

I have a problem with notifications (SDK 1.0)

I have wrote an application that, when an event occurs, prepare a
notification and puts it on the status bar.
Each of these notifications should start different instances of the
same Activity (a simple activity that shows some information).
The activity receives with the data to show also the integer value to
use to dismiss the notification that started it.
Let's call this Activity "show".

Here is the problem: let's say i prepare a notification that should
launch my activity "show" with data "first" and put it on the status

Now I prepare a second notification that should launch "show" with
data "second" and put it on the status bar.

The two notifications have different values to be dismissed.

I would like that now, opening the menu containing notifications, if I
click the first notification "show" is launched and shows to the user
"first", then the notification is dismissed. If I click on the second
notification "show" should be launched, display "second", and also
this notification should be dismissed.

Instead what I get is that, independently of which of the two
notifications I click, "show" il launched and displays "first", after
that it dismiss the notification I clicked. If now I click the
remaining notification "show is launched, displays again "first" and
does't dismiss the notification (I must click clear notifications)

I think the problem is to prepare the PendingIntent with some flag,
but I don't know which.
I build the PendingIntent in this way:

PendingIntent myPendingIntent = PendingIntent.getActivity(context,

where context is the context
int is 4 (a random value)
myIntent is the Intent to be used to launch the Activity (it has the

should I use some other flags?


Other Threads

1. start bluetooth failed from UI

  On my Netbook
$bttest enable

command hciconfig -a and hcitool scan can get information of device.
But turn on from UI, there's no any response. it's why? have no any
idea. i don't want to analyze from app of UI.  I skiped rfkill in
bluetooth.c,because my platform have no use it. I think I have started
services about bluetooth. follow my init.rc
    chmod 0660 /dev/ttyS1
    chown bluetooth bluetooth /dev/ttyS1
service dbus /system/bin/dbus-daemon --system --nofork
    socket dbus stream 660 bluetooth bluetooth
    user bluetooth
    group bluetooth net_bt_admin
service hcid /system/bin/hcid -s -n -f /etc/bluez/hcid.conf
    socket bluetooth stream 660 bluetooth bluetooth
    socket dbus_bluetooth stream 660 bluetooth bluetooth
    group bluetooth net_bt_admin misc
service hciattach /system/bin/hciattach -n /dev/ttyS1 texas 115200
    user bluetooth
    group bluetooth net_bt_admin misc
service hfag /system/bin/sdptool add --channel=10 HFAG
    user bluetooth
    group bluetooth net_bt_admin
Please help me?

Best Regards!

2. detect trackball events in dialog

I have a dialog that sets its content view to a View object it creates
(a derived View actually) and the view can detect touch events without
any trouble, no callback registering or listeners or anything...but I
can't get any trackball events.  I tried overriding onTrackballEvent()
and even dispatchTrackballEvent().  Neither function fires when the
trackball is moved or pressed while the dialog is the window.

I see that one can register for clicks and various things, but how
does one access trackball events?


3. Hot to create a mutable Bitmap from the Camera, draw another Bitmap on top, and save it

4. Adding IM providers to native IM app

5. Where can we petition for better Android Market payment options (cell-phone bills...)?

6. Wifi & 3G

7. Obtaining IP address when on 3G (MOBILE) connection