I want that when a user clicks a button in an app, they get a dialog box that allows them to select a wallpaper from albums, a set of live wall papers, system wall papers or even images. I’d like the functionality to be exactly like it is with the home page wallpaper except that I need this selected image to be the background of my Main Activity. So, When they select it and click set as wallpaper, this image should be used as app’s background drawable.
I have this for a start:
Intent intent = new Intent(
WallpaperManager.ACTION_LIVE_WALLPAPER_CHOOSER);
intent.putExtra(WallpaperManager.COMMAND_TAP,
new ComponentName(MainActivity.class),
Wallpaper.class));
startActivity(intent);
My second idea is to use set background bitmap using WallpaperManager.getInstance(this).setBitmap(bitmap);
I don’t know which direction to move..
This is for getting the current system wallpaper:
Just get the drawable from WindowManager:
An set it to a ImageView: