0

I'm working wallpaper application and having a problem with set wallpaper intent. I'm tried FileProvider, nothing changed.

My code showing this intent: (1) https://i.ibb.co/RcW15qb/1.png

after select: (2) https://i.ibb.co/nsQNvms/Screenshot-1568305811.png

but I want like this: (3) https://i.ibb.co/F53p6sv/Screenshot-1568305398.png

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

I'm searched and tried smiliar set wallpaper intent example. Working but picture 1 and 2. I need intent like picture 3

Edit: I found but without scrolling and fixed options

 val intent = Intent("android.service.wallpaper.CROP_AND_SET_WALLPAPER")

(4) https://i.ibb.co/H4vqdGF/Screenshot-1568315850.png

Castiel
  • 1
  • 3
  • Image 1 shows you're sharing the image to another app. That's when you lose control over what happens next. So what you see in image 2 and 3 are not android intents. They're different applications used to set walpapers that allow receiving "image/*" type. These applications can come with android or from the store. If you need more powerfull wallpaper setting you have to download more powerful app and then choose it from the list (if the app allows receiving images to set them as a wallpaper). – Krystian G Sep 12 '19 at 18:36
  • Yes, these and other wallpaper apps from market and set wallpaper like picture 3. But how ? I can't find it. – Castiel Sep 12 '19 at 18:46
  • When I run your code I see also `Nova wallpaper` which is part of `Nova launcher` app (but that's probably more than you need). I also see `Wallpaper (Gallery)` (which is part of standard Gallery app that comes with Huawei phone). Both of them allow setting "scrollable" wallpaper. – Krystian G Sep 12 '19 at 18:57
  • Yes, I know. if click to "Other" in picture 3, open the menu in picture 1. I want to integrate my app. But I don't know. – Castiel Sep 12 '19 at 19:05
  • 1
    Finally, I found. But without Scrolling and Fixed settings. val intent = Intent("android.service.wallpaper.CROP_AND_SET_WALLPAPER") – Castiel Sep 12 '19 at 19:18

0 Answers0