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.

有帮助吗?

解决方案

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;
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top