作者:手机用户2602927443 | 来源:互联网 | 2022-10-19 14:34
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中增加设置桌面的权限