我正在制作一个应用程序,允许用户使用Android Intent共享图像,但如何获取位图的URI而无需将其保存到SD卡中?
我已经使用了这段代码,它可以正常工作,但我不需要将此位图保存到SD卡中。
我已经使用了这段代码,它可以正常工作,但我不需要将此位图保存到SD卡中。
private Uri getImageUri(Context inContext, Bitmap inImage) {
ByteArrayOutputStream bytes = new ByteArrayOutputStream();
inImage.compress(Bitmap.CompressFormat.JPEG, 100, bytes);
String path = Images.Media.insertImage(inContext.getContentResolver(), inImage, "title", null);
return Uri.parse(path);
}
我需要获取那个URI,但不想将位图保存到SD卡