In Android (on JB), how can I add an action to a custom extended notification?

I played with the new rich notificaitons in Bean Jelly, and everything works as expected when I set up a new notificaiton using templates Notification.BigPictureStyle, Notification.BigTextStyleor Notification.InboxStyle. I can use the method Notification.Builder.addAction(), and the action buttons are displayed at the bottom of the extended notification. But when I try to create a cutsom notification using Notification.bigContentView , the action buttons never appear.

Just to clarify, if I never installed bigContentView, buttons are displayed. But as soon as this field is configured on a custom RemoteViews object, the buttons disappear.

Does anyone have any ideas on why this is happening?

+5
source share
2 answers

Various builders Big...Stylecreate their own bigContentView. If you need your own bigContentView, you should add the buttons yourself, perhaps by examining the source code for these collectors and seeing how they do it.

+2
source

When you add your own bigContentView, it will replace the content generated by Notification.BigPictureStyle, Notification.BigTextStyle or Notification.InboxStyle. As follows from common sense considerations, you need to add the button yourself, and by creating your own remoteView using the buttons, then add it as a contentView.

, .

+1

All Articles