Android - Set Wallpaper using the "Set Wallpaper" intent

set wallpaper android
set wallpaper android fit screen
set as wallpaper images
how do i make a picture my wallpaper on android
set wallpaper photo
change wallpaper android lock screen
how do i get my old wallpaper back android
android wallpaper

The question was asked here and here but there was no real answer.

Android has a built-in "Set Wallpaper" feature, such feature is available when starting an activity intent with mime "image/jpeg" or long-tapping on images in browser.

My question is: how do I programmatically invoke the built-in "Set Wallpaper" feature using a file Uri?

Seems like there is no answer to the question however I did discover a workaround:

    Intent intent = new Intent(Intent.ACTION_ATTACH_DATA);
    intent.addCategory(Intent.CATEGORY_DEFAULT);
    intent.setDataAndType(uri, "image/jpeg");
    intent.putExtra("mimeType", "image/jpeg");
    this.startActivity(Intent.createChooser(intent, "Set as:"));

How to change your Android wallpaper in 2019, How to Change Wallpaper on Android Tablets. Wallpaper is the background on the Home and lock screens on your Android tablet. You can change and set the  There’s another, perhaps easier way to get to your wallpaper settings on most Android devices. Tap-and-hold on a blank area of the home screen, avoiding all icons or widgets. After a couple seconds, you should get an option to change the wallpaper or add widgets.

For me work only:

Intent intent = new Intent(Intent.ACTION_ATTACH_DATA);
intent.addCategory(Intent.CATEGORY_DEFAULT);
intent.setDataAndType(uri, "image/*");
intent.putExtra("mimeType", "image/*");
this.startActivity(Intent.createChooser(intent, "Set as:"));

If mime "image/jpeg" apps not found image.

How to Change Wallpaper on Android Tablets, How to change the wallpaper for the Home screen or the Lock screen on your Android smartphone. How to set your own pictures as wallpapers  Can You Change Backgrounds On Zoom For Android? Here's What You Should Know. By Daffany Chan. April 5, 2020. If you're using an iPhone 8 or later with an updated Zoom app, you can able to

If your app crashes after choosing the application you want to set wallpaper with, you need to add

intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);

A typical example is attachments in a email app. Access to the emails should be protected by permissions, since this is sensitive user data. However, if a URI to an image attachment is given to an image viewer, that image viewer no longer has permission to open the attachment since it has no reason to hold a permission to access all email.

The solution to this problem is per-URI permissions: when starting an activity or returning a result to an activity, the caller can set Intent.FLAG_GRANT_READ_URI_PERMISSION and/or Intent.FLAG_GRANT_WRITE_URI_PERMISSION. This grants the receiving activity permission access the specific data URI in the intent, regardless of whether it has any permission to access data in the content provider corresponding to the intent. https://developer.android.com/guide/topics/permissions/overview

val intent = Intent(Intent.ACTION_ATTACH_DATA)
        .apply {
            addCategory(Intent.CATEGORY_DEFAULT)
            setDataAndType(uri, "image/*")
            putExtra("mimeType", "image/*")
            addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION)
        }
    startActivity(Intent.createChooser(intent, "Set as:"))

4 ways to change the wallpaper on your Android smartphone , so that's a plus. When you try to open it, it won't open. Below are my codes, I want to use wallpaper manager to set as wallpaper. I'm using Universal Image Loader, but i dont know how implement wallpaper manager. My setWall() is not working, kinda confus

And for me work only

 Intent intent = new Intent();
 intent.setAction(Intent.ACTION_ATTACH_DATA);
 intent.addCategory(Intent.CATEGORY_DEFAULT);
 intent.setDataAndType(ContactsContract.Contacts.CONTENT_URI, "image/*");
 intent.putExtra("mimeType", "image/*");
 startActivityForResult(Intent.createChooser(intent, "Select service:"), position);

position - it is your : getIntent().getExtras().getInt("id_test");

Where is the background image saved?, screen. Choose whether you want to set the wall paper for your Home screen, Lock screen or both Home and lock screen. And you can have a different wallpaper for each one using GO Multiple Wallpaper. How To Enable Multiple Wallpapers in Android Android is well known for the different ways to tweak and customize

How to set a background picture on your Android or iOS smartphone , Click on the share icon on the lower left corner of the screen, then select 'Use as Wallpaper.' Then choose to set the photo as either the lock  Go to 'Settings' and select the 'Wallpaper' option Select 'Choose a new wallpaper.' You will then be given the option of selecting from the phones stored designs (dynamics and stills), or you can

How To Set A Wallpaper On Android, Video showing you how to set or change a background wallpaper on your Android device. I Duration: 1:15 Posted: Dec 20, 2011 To use a curated image, tap a category an image. Pixel 4, 3, and 2: To use a live wallpaper, tap Come Alive or Living Universe a wallpaper. If needed, tap Download. Pixel 4 only: To interact with your wallpaper using quick gestures, tap Come Alive a wallpaper Download. At the top, tap Set wallpaper. If available, pick which screens show the wallpaper.

WallpaperManager, Registers a listener to get notified when the wallpaper colors change. void, clear(​int which). Remove one or more currently set wallpapers 

Comments
  • I'm getting the error: Unable to load photo. I'm using a drawable and getting its Uri: Uri uri = Uri.parse(context.getResources().getDrawable(drawable).toString());
  • @NehaAgarwal try using Uri uri = Uri.parse("android.resource://your.package.here/drawable/image_name")