Created
October 8, 2018 13:06
-
-
Save malikkurosaki/876beeb9957df350a483fc0c4e7427ab to your computer and use it in GitHub Desktop.
malikkurosaki bitmap to uri
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public 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); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The best solution ever!