Skip to content Skip to sidebar Skip to footer

Setting Wallpaper From Assets

when i try to set Wallpaper from Assets it takes time to get the job done so maybe there is easier way instead of my hardcode public void Setwallpaper(int position , Context conte

Solution 1:

Try this

WallpaperManagermyWallpaperManager=WallpaperManager.getInstance(getApplicationContext());
    InputStreamims= getAssets().open("yourimage.jpg");
    myWallpapaerManager.setStream(ims)

Solution 2:

Above example works, don't forget to add permission

Post a Comment for "Setting Wallpaper From Assets"