Lim Thye Chean
Lim Thye Chean

Reputation: 9494

Choose wallpaper instead of choosing live wallpaper?

In Android there is a very convenient way of getting the user to choose and set a live wallpaper.

Intent intent = new Intent(WallpaperManager.ACTION_LIVE_WALLPAPER_CHOOSER);
startActivity(intent);

Is there a similar way for user to choose and set a wallpaper instead (or better yet, allow them to choose wallpaper/live wallpaper/gallery)?

Thanks!

Upvotes: 0

Views: 380

Answers (2)

Dushyant Patel
Dushyant Patel

Reputation: 685

Try this

public void setIt(){

Context c = this.getBaseContext();
Bitmap bp = BitmapFactory.decodeResource(getResources(), "your_array");
c.setWallpaper(bp);
}

Upvotes: 0

tianwei
tianwei

Reputation: 1879

Try this:

private void chooseWallpaper() {

final Intent pickWallpaper = new Intent(Intent.ACTION_SET_WALLPAPER);
Intent chooser = Intent.createChooser(pickWallpaper, getText(R.string.chooser_wallpaper));
startActivityForResult(chooser, REQUEST_PICK_WALLPAPER);
}

Upvotes: 1

Related Questions