需要在发通知的时候同时定义两个Notification.Builder,一个是如你图一显示,通知布局为你自定义的RemoteView;一个是如你图二显示,通知使用通知标准布局,他们之间通过 setPublicVersion建立联系。
具体参考Google systemui 关于screenshot 里面通知的处理或是找一个开源的音乐播放器应该实现好了吧
API参考Notification.java
/**
* Supply a replacement Notification whose contents should be shown in insecure contexts
* (i.e. atop the secure lockscreen). See {@link #visibility} and {@link #VISIBILITY_PUBLIC}.
* @param n A replacement notification, presumably with some or all info redacted.
* @return The same Builder.
*/
public Builder setPublicVersion(Notification n) {
mPublicVersion = n;
return this;
}