【问题标题】:Use a image from url in a android wear notification在 android 磨损通知中使用来自 url 的图像
【发布时间】:2015-09-27 17:23:54
【问题描述】:

我在我的项目中使用 androidwear 手表的通知。 我的意图是通知的背景将是从 url 中提取的图像,但我不知道该怎么做。

NotificationCompat.WearableExtender() 的文档解释:

.setBackground(bBitmap);

但是.. 如果我想从 url 加载背景?

我会读到这个,但没有成功。

提前致谢。

【问题讨论】:

    标签: android android-notifications wear-os


    【解决方案1】:

    使用 Volley(高效网络库)下载 URL 中的图像并使用它。您将获得位图响应。 Volley ImageRequest 有各种教程。

    查看这个问题Import Android volley to Android Studio 了解如何将 volley 库添加到 android-studio

    试试这个以学习使用 volley 从 url 请求图像。

    https://developer.android.com/training/volley/request.html

    如果你仍然做不到,我可以帮助你编写代码。 快乐编码:)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多