开始默认设置为带位图的墙纸意图/活动 [英] Starting default Set as Wallpaper intent / activity with bitmap

查看:75
本文介绍了开始默认设置为带位图的墙纸意图/活动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个从网址下载的位图,并希望通过我的位图启动android的默认设置为墙纸意图/活动.我找到了以下解决方案,但缺少"R.String.set_as"和"REQUEST_ID_SET_AS_WALLPAPER"的值.

I have a bitmap downloaded from a url and want to start android's default set as wallpaper intent/activity passing my bitmap. I have found following solution but missing value of "R.String.set_as" and "REQUEST_ID_SET_AS_WALLPAPER".

https://stackoverflow.com/a/26869604/4767525

此字段的值应该是什么?

what should be the value of this fields?

谢谢

推荐答案

不是很了解REQUEST_ID_SET_AS_WALLPAPER.我认为这与图像的大小有关. R.String.set_as只是一个字符串:"Set as:"

Don't really know about REQUEST_ID_SET_AS_WALLPAPER. I think it is related to the size of the image. R.String.set_as is just a string: "Set as:"

使用此代码:

Intent intent = new Intent(Intent.ACTION_ATTACH_DATA);
                intent.setDataAndType(contentUri, "image/*");
                intent.putExtra("mimeType", "image/*");
                intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
                startActivity(Intent.createChooser(
                        intent, "Set as:"));

这篇关于开始默认设置为带位图的墙纸意图/活动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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