set an image from gallery for background of desktop phone (android-java)

Viewed 859

I have one app that like a Slide show or gallery but i want when anybody use this app be able to set the image to background on android phone

the app can show image i just want to able set image to background - and its can be enough if i can set address of image in Variable and then i can use this Code

WallpaperManager wpm = WallpaperManager.getInstance(getApplicationContext());
try {
    wpm.setResource(R.drawable.image_1);
} catch (IOException e) {
    e.printStackTrace();
}
1 Answers
Related