简体   繁体   English

在可绘制文件夹中共享图像时

[英]On sharing image in drawable folder

Sorry for repeated question. 对不起,重复的问题。 I searched a lot on the Internet, got a lot of links too. 我在互联网上搜索了很多东西,也获得了很多链接。 But none of it worked correctly. 但是没有一个能正常工作。

I've an Image in a drawable folder. 我在可绘制文件夹中有一个图像。 Wanted to share t via apps like Gmail, Messaging etc. How's it possible? 希望通过Gmail,邮件等应用共享。怎么可能? I used the following code: 我使用以下代码:

shareIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse("android.resource://" + getPackageName() + "/" + R.drawable.myImage));

But this stop the "com.android.mms" what to do? 但这停止了“ com.android.mms”怎么办?

Also, is any permission required to be added? 另外,是否需要添加任何权限? Or am I missing out anything? 还是我错过了什么? Does this sharing work on Android 2.2, cause I'm testing on it? 这种共享是否可以在Android 2.2上运行,导致我正在对其进行测试?

you have to store your image to the internal/external storage first, then you can be able to share it by using Gmail, .... 您必须先将图片存储到内部/外部存储中,然后才能使用Gmail共享图片,...。

More info in comments 评论中的更多信息

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM