Aashish J Kumar
Aashish J Kumar

Reputation: 303

Set image from app as wallpaper

I have developed an app which have few images in it. I have placed them in drawable folder. I want to give an option for the users to choose anyone of those images and make it as device's wallpaper. How can I do that? Should the user store it first to gallery and then make it as wallpaper?

Upvotes: 1

Views: 670

Answers (2)

Menno
Menno

Reputation: 89

You should let the users choose, and their decision should be placed in a variable. So if users choose #1, the wallpaper1 will be in the background of the xml. If users choose #3, wallpaper3 will be in the background of the xml. So you define 'backgroundwallpaper' in your xml, and define that by using a variable.

Upvotes: 0

Related Questions