Skip to content
This repository has been archived by the owner on Jul 15, 2021. It is now read-only.

replace low-level bitmap handling code with glide #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,15 +114,11 @@ public void pickImageFromGallery(View view) {
// Declare a stream to read the image data from the SD card
InputStream inputStream;

try {
// The content resolver provides applications access to persistent data
// Then openInputStream() opens a stream on to the content associated with a content URI.
inputStream = getContentResolver().openInputStream(imageUri);

try {
// Get a bitmap from the stream
Bitmap bitmap = BitmapFactory.decodeStream(inputStream);

imageView.setImageBitmap(bitmap);
Glide.with(this)
.load(imageUri)
.into(imageView);
} catch (FileNotFoundException e) {
e.printStackTrace();
// Show a message to the user indicating that the image is unavailable
Expand Down