Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 275
CQM Avatar asked Jan 16 '14 20:01

CQM


1 Answers

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;
like image 172
Eric Woodruff Avatar answered Sep 24 '22 13:09

Eric Woodruff