设置桌面壁纸代码

其实就一句,不过前面需要先获取bitmap对象。

        Resources res=getResources();  
BitmapDrawable bmpDraw=(BitmapDrawable)res.getDrawable(R.id.abc);
Bitmap bmp=bmpDraw.getBitmap();
try{
setWallpaper(bmp);
}catch(IOException e) {
e.printStackTrace();
}

至于如何设置待机壁纸,暂时还不太清楚~!

原文地址:https://www.cnblogs.com/wzc0066/p/2948301.html