如何创建一个类似于从谷歌Play音乐应用的通知 [英] How to create a notification similar to Play Music app from Google

查看:175
本文介绍了如何创建一个类似于从谷歌Play音乐应用的通知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图创建一个通知是非常相似,从谷歌的播放音乐应用程序使用。

几个问题,希望有人能回答。

  1. 在此通知进行自定义RemoteViews?
  2. 是对X用于关闭NotificationCompat.Builder的API的小部件的一部分?或者只是一个自定义的远程视窗的一部分?
  3. 如果它是所有自定义视图我如何可以设置自定义远程视窗的最小化和最大化状态?
解决方案

是的,这一切与定制完成 RemoteViews 。在文档的<一个你会看到href="http://developer.android.com/reference/android/app/Notification.html"><$c$c>Notification,有一个领域<一个href="http://developer.android.com/reference/android/app/Notification.html#bigContentView"><$c$c>bigContentView随着<一href="http://developer.android.com/reference/android/app/Notification.html#contentView"><$c$c>contentView.

I'm trying to create a notification that is very similar to what the "Play Music" app from Google uses.

Few questions that hopefully someone can answer.

  1. Is this notification done with custom RemoteViews?
  2. Is the X for closing the widget part of the NotificationCompat.Builder APIs? or simply part of a custom RemoteView?
  3. If it is all custom views how can I set a custom RemoteView for minimized and maximized states?

解决方案

Yes, all of that is done with custom RemoteViews. You'll see in the docs for Notification, there's a field for bigContentView along with contentView.

这篇关于如何创建一个类似于从谷歌Play音乐应用的通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆