Skip to content

Instantly share code, notes, and snippets.

@sprejjs

sprejjs/step3.java

Created Jul 26, 2017
Embed
What would you like to do?
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (resultCode == RESULT_OK && requestCode == GALLERY_REQUEST_CODE) {
try {
Uri selectedImage = data.getData();
InputStream imageStream = getContentResolver().openInputStream(selectedImage);
selectedImageView.setImageBitmap(BitmapFactory.decodeStream(imageStream));
} catch (IOException exception) {
exception.printStackTrace();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.