Wednesday, June 30, 2010

[android-developers] Placing focusable & clickable views in a custom expanded view in the notification bar


Has anyone tried to put Views, e.g. Buttons, into a list item of the
notification bar?
In my opinion this would be really helpful for actions that should be
accessible in a very fast manner, like activating/deactivating WiFi or
the 3G network. In fact I saw something like this implementet on the
Samsung Galaxy S device, and now I am trying to achieve the same for
all devices.

I created a custom Notification using this guide:

Placing two buttons in my own layout was easy. But here is the
problem: The class RemoteViews (
) has a method called setOnClickPendingIntent(int viewId,
PendingIntent pendingIntent), but it doesn't seem to work. The
buttons are not focusable nor clickable, only the whole list item as
such is clickable. And when it is clicked the PendingIntent of the
notification is executed, not the PendingIntent of one of my buttons.

Any suggestions?


Marc Reichelt ||

You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to
To unsubscribe from this group, send email to
For more options, visit this group at

No comments:

Post a Comment