我怎样才能得到手机壁纸的Andr​​oid? [英] How can I get Phone wallpaper in Android?

查看:112
本文介绍了我怎样才能得到手机壁纸的Andr​​oid?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我工作的Andr​​oid应用程序。我怎样才能得到手机壁纸的Andr​​oid?请帮我。给我的样品code的例子。

I am working on an Android application. How can I get Phone wallpaper in Android? Please help me. Give me the sample code example.

推荐答案

您需要使用<一个href="http://developer.android.com/reference/android/app/WallpaperManager.html"><$c$c>WallpaperManager其中,除该文件中提到的其它东西,可以让你获得当前的墙纸。

You need to use WallpaperManager which, among other things mentioned in the documentation, allows you to get the current wallpaper.

下面的代码片断将获得当前的壁纸(如果没有墙纸设置系统默认值)。

The following snippet will get the current wallpaper (or the system default if no wallpaper is set).

final WallpaperManager wallpaperManager = WallpaperManager.getInstance(this);
final Drawable wallpaperDrawable = wallpaperManager.getDrawable();

这篇关于我怎样才能得到手机壁纸的Andr​​oid?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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