您的位置:首页 > 移动开发 > Android开发

Android设置桌面背景图片的方法

2014-08-23 23:42 393 查看
1.设置桌面背景图片的方法

Resources res=getResources();

BitmapDrawable bmpDraw=(BitmapDrawable)res.getDrawable(R.drawable.icon);

Bitmap bmp=bmpDraw.getBitmap();

try{

setWallpaper(bmp);

}catch(IOException e) {

e.printStackTrace();

}

2.在manifest中增加设置桌面的权限

<uses-permission android:name="android.permission.SET_WALLPAPER" />
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: