Android使用意图设置墙纸 [英] Android set wallpaper using intent

查看:76
本文介绍了Android使用意图设置墙纸的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试制作墙纸应用程序.我可以使用墙纸管理器设置墙纸.但是我想要的是,当我单击按钮时,应该打开一个新的意图,这应该是设置设备墙纸的默认方式.(当我们尝试将图像表单库设置为墙纸时得到的屏幕,我们可以在其中选择图像区域等).我go了一下,但找不到任何解决方案.

I am trying to make wallpaper application. I am able to set the wallpaper using wallpaper manager. But what i want is when i click a button a new intent should open which should be the default way of setting wallpaper of the device. (the screen we get when we try to set an image form gallery as wallpaper, where we can select the area of the image etc etc). I have goggled but couldn't find any solution.

推荐答案

如果您不必指定目标应用,这是一个更好的解决方案;

This is a better solution, wher you dont have to specify a target app;

Intent intent = new Intent(Intent.ACTION_SET_WALLPAPER);
startActivity(Intent.createChooser(intent, "Select Wallpaper"));

这篇关于Android使用意图设置墙纸的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆