Re: Sending notification



Now I have this problem:
I manage to create a Source and a new Notification subclass to add a
pair of buttons to the notification, One for Closing and one for doing
something else.
1. When the user don't interact with the first notification, the
notification stays in the notification bar, and that's what I want
2. The problem is when the user click 'Close' button I added to the
notification (which I connected to 'this.destroy'). That close the
notification, and the source disappears from the notification bar if
there was just one notification, and then if I launch a notification
again and the user don't interact with it, the new notification does
not stay in the bar, cause the sources is missing.
Why this.destroy from the notification class remove the source from
the notification bar ?

Erick

> You need to call notification.setResident(true) before calling
> source.notify(), and you need to have your own custom Source
> (SystemNotificationSource calls .setTransient(true))
> Note that resident will not force the notification into staying in
> banner mode (that is, in the middle of the screen), it will just make
> clicks on actions and on the background have no effect.
> If you want to destroy on click, but not on action button press, connect
> to "clicked" and call .destroy(). If you want to destroy on any action,
> use the default behavior (.setTransient(false) and .setResident(false)).
>
> Giovanni
>
>



-- 
El derecho de expresar nuestros pensamientos tiene algún significado
tan sólo si somos capaces de tener pensamientos propios.
El miedo a la libertad, Erich Fromm


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]