码迷,mamicode.com
首页 > 移动开发 > 详细

Andoird开发手机壁纸

时间:2017-08-26 22:48:11      阅读:287      评论:0      收藏:0      [点我收藏+]

标签:ring   class   oid   问题   res   alt   systems   enter   mis   

Android 开发手机壁纸3种方法

 

首先使用WallpaperManager wpm = (WallpaperManager) getActivity().getSystemService(Context.WALLPAPER_SERVICE);获得WallpaperManager,然后进行设置:

1、使用WallpaperManager的setResource(int ResourceID)方法

2、使用WallpaperManager的setBitmap(Bitmap bitmap)方法

3、重写ContextWrapper 类中提供的setWallpaper()

权限:

<uses-permission android:name="android.permission.SET_WALLPAPER"/>
 
注意:图片大小不能调整,会拉伸,会变形
 (哪位大牛有方案,请给小弟留言)优化问题,后续跟进解决……
 
 

Andoird开发手机壁纸

标签:ring   class   oid   问题   res   alt   systems   enter   mis   

原文地址:http://www.cnblogs.com/wookong/p/7436507.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!