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" />

相关文章:

  • 2022-01-20
  • 2021-06-15
  • 2021-12-18
  • 2022-12-23
  • 2022-12-23
  • 2021-12-19
  • 2021-11-24
  • 2021-12-06
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-26
  • 2022-12-23
  • 2021-12-07
  • 2022-12-23
相关资源
相似解决方案