CQM
CQM

Reputation: 44228

Android Remoteviews for expanded notifications

The expanded notifications introduced in Jelly Bean allows adding actions. The actions appear as buttons in a row. If I wanted to modify this with my own custom view I would consider a remoteview.

Do expanded notifications allow for remoteviews? I can only find examples of remoteviews being used in simple notifications before the expanded notifications existed.

Upvotes: 5

Views: 6719

Answers (1)

Eric Woodruff
Eric Woodruff

Reputation: 6410

It appears that http://codeversed.com/expandable-notifications-android/ has the answer in the Custom View at the end.

So what if the rich notification styles don’t provide you with the layout you need? Easy, just create your own layout and pass it to the builder. One little fact to retain is that notifications use remote views, which means you need to create a layout using a RemoteView. Below is exactly how you would need to create this custom RemoteView.

notification.bigContentView = expandedView;

Upvotes: 8

Related Questions