Android的 - 如何设置墙纸图像 [英] Android - how to set the wallpaper image
问题描述
是否有可能以编程设定的Android墙纸图像?我想创建一个下载一个图像从网页并定期更新的主屏幕墙纸的服务。
从<一个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屋!