Android的 - 如何设置墙纸图像 [英] Android - how to set the wallpaper image

查看:155
本文介绍了Android的 - 如何设置墙纸图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有可能以编程设定的Andr​​oid墙纸图像?我想创建一个下载一个图像从网页并定期更新的主屏幕墙纸的服务。

解决方案

从<一个href="http://developer.android.com/reference/android/app/WallpaperManager.html#setStream%28java.io.InputStream%29">this在开发者网站页面:

 公共无效setStream(InputStream中的数据)
 

  

修改当前系统壁纸到一个特定的字节流。该给予的InputStream被复制到持久存储器,现在将被用作墙纸。目前,它必须是一个JPEG或PNG图像

Is it possible to set the android wallpaper image programatically? I'd like to create a service that downloads an image from the web and updates the home screen wallpaper periodically.

解决方案

From this page on the developer site:

public void setStream (InputStream data)

Change the current system wallpaper to a specific byte stream. The give InputStream is copied into persistent storage and will now be used as the wallpaper. Currently it must be either a JPEG or PNG image.

这篇关于Android的 - 如何设置墙纸图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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