Skip to content Skip to sidebar Skip to footer

Adding Actions To A Notification In Jellybean Ignores The Custom Layout Set With Setcontent

I'm creating a notification with a custom layout using setContent, and it works fine. But when I'm adding actions to the notification with addAction(), my custom layout is being ig

Solution 1:

Had exactly the same issue! Instead of calling

builder.setContent(remoteView)

Which replaces the normal content, you should do it like this:

NotificationstatusNotification= builder.build();
statusNotification.bigContentView = remoteViews;

Which will set your layout to the bigContentView, which becomes visible after expanding!

NOTE: Doing this will prevent your action buttons from showing up. See In Android (on JB), how can I add an action to a custom rich notification? for how to get around this

Post a Comment for "Adding Actions To A Notification In Jellybean Ignores The Custom Layout Set With Setcontent"