我有一个应用程序,可以截取屏幕并使用共享意图分享。为了避免每次用户想要简单地分享图像时保存多个图像,以下是我用于保存到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"));
然而,我无法弄清楚如何简单地保存位图,例如...
share.putExtra(Intent.EXTRA_STREAM, theBitmap);
有没有一种方法可以在不保存图像的情况下完成这个操作?
谢谢。