android - save image from web server and set it as wallpaper

后端 未结 1 651
悲&欢浪女
悲&欢浪女 2020-12-16 08:51

Can anyone please provide me some idea/guidance on how to save an image from a webserver and set it as wallpaper? i am developing an android application which needs to do th

相关标签:
1条回答
  • 2020-12-16 08:54

    I had tried writing my own code but it doesn't work as i can't find my images after download. here is my existing code.

    Your code would save the image in the data/data/<your_app_package_name> folder of the phone. You can then use either a WallpaperManager instance or do a context.setWallpaper(bitmap)(this is deprecated) to set your bitmap as the wallpaper.

    0 讨论(0)
提交回复
热议问题