安卓:分享位图未保存到SD [英] Android: Share Bitmap Not Saved To SD

查看:114
本文介绍了安卓:分享位图未保存到SD的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个应用程序,需要一个屏幕截图和股票这与份额的意图。每一个用户希望简单地共享图像的时间,而不是保存多个图像。下面是code口用于保存到SD

I have an app that takes a screenshot and the shares this with the share intent. Rather than save multiple images each time a user wants to simply share the image. Below is the code I used for images saved to the SD

Intent share = new Intent(Intent.ACTION_SEND);
share.setType("image/png");

dir = "file://" + Environment.getExternalStorageDirectory().getAbsolutePath() + File.separator + "Folder/" + location;
share.putExtra(Intent.EXTRA_STREAM, Uri.parse(dir));

startActivity(Intent.createChooser(share, "Share Image"));

不过,我无法弄清楚如何将一个简单的位图保存,如...

However I cant figure out how to simply save a Bitmap such as...

share.putExtra(Intent.EXTRA_STREAM, theBitmap);

有没有办法做到这一点不保存的图像?

Is there a way to do this without saving the image?

感谢

推荐答案

我eneded做什么是保存一个温度图像到SD /电话,只是在每一次改写。

What I eneded up doing was saving one "Temp" image to the SD/Phone and just overwrite the each time.

这篇关于安卓:分享位图未保存到SD的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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