I am developing a simple app that sets wallpapers based on user input. I am missing code for setting wallpapers. I have been looking for it in lots of websites in vain. Can
u can try
InputStream inputStream = getResources().openRawResource(wallpaperResource);
Bitmap setWallToDevice = BitmapFactory.decodeStream(inputStream);
try {
getApplicationContext().setWallpaper(setWallToDevice);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
however this method is deprecated so u can use
try {
WallpaperManager.getInstance(getApplicationContext()).setResource(wallpaperResource);
} catch (IOException e){
e.printStackTrace();
}