Answers for "how to convert bitmap to uri in android"

2

how to convert bitmap to uri in android

public Uri getImageUri(Context inContext, Bitmap inImage) {
  ByteArrayOutputStream bytes = new ByteArrayOutputStream();
  inImage.compress(Bitmap.CompressFormat.JPEG, 100, bytes);
  String path = MediaStore.Images.Media.insertImage(inContext.getContentResolver(), inImage, "Title", null);
  return Uri.parse(path);
}
Posted by: Guest on July-14-2021

Code answers related to "how to convert bitmap to uri in android"

Browse Popular Code Answers by Language