6

That is my question. For them who dont know what i am asking, I want to make this menu to appear in my app http://db.tt/GQX9GBYF . The thing is that I Dont have any idea how to do it. I think that I have to create an intent, from it obtain image path and then, set it as background. But i dont know the exact way to do it...

Please, anyone could post me an example, please???? ;)

I have to say that I managed to do it by launching native gallery app, but I want to set live wallpapers too

BamsBamx
  • 4,139
  • 4
  • 38
  • 63

2 Answers2

6

You Intent.ACTION_SET_WALLPAPER for starting ContaxtMenu for Selecting Wallpaper as:

Intent intent = new Intent(Intent.ACTION_SET_WALLPAPER);
startActivity(Intent.createChooser(intent, "Select Wallpaper"));
ρяσѕρєя K
  • 132,198
  • 53
  • 198
  • 213
  • ok it worked, but it sets launcher background, and I only want to set wallpaper for my app... any idea?? THANKS A LOT!! – BamsBamx May 27 '12 at 16:13
  • myLayout.setBackgroundDrawable(getWallpaper()); gets the wallpaper and sets it for your layout – user1446632 Feb 10 '13 at 19:07
  • Heads up: if you just pass the intent instead of calling Intent.createChooser, the default app will start (in my case that was the "Live Wallpaper"-chooser) – Lerk Mar 15 '19 at 13:09
1

Currently I'm working on the same thing. The accepted answer is correct but if you want to use wallpaper as your app's background, then you have to use Wallpaper theme & call the Intent.Action_Set_Wallpaper to pick wallpaper.

public void onCreate(Bundle savedInstanceState) {

 Activity.this.setTheme(android.R.style.Theme_Wallpaper);

super.onCreate(savedInstanceState);
setContentView(/*some layout*/);
}

//on button click

Intent intent = new Intent(Intent.ACTION_SET_WALLPAPER);
startActivity(Intent.createChooser(intent, "Select Wallpaper"));
user2551070
  • 71
  • 2
  • 11