1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-08-13 17:03:48 -04:00

Close stream when done (StrictMode error).

This commit is contained in:
Joe Steele 2013-08-02 12:37:00 -04:00
parent fce39f0fce
commit 2df436e7bc

View File

@ -206,19 +206,21 @@ public class AttachmentView extends FrameLayout implements OnClickListener, OnLo
}
private Bitmap getPreviewIcon() {
Bitmap icon = null;
try {
return BitmapFactory.decodeStream(
mContext.getContentResolver().openInputStream(
InputStream input = mContext.getContentResolver().openInputStream(
AttachmentProvider.getAttachmentThumbnailUri(mAccount,
part.getAttachmentId(),
62,
62)));
62));
icon = BitmapFactory.decodeStream(input);
input.close();
} catch (Exception e) {
/*
* We don't care what happened, we just return null for the preview icon.
*/
return null;
}
return icon;
}
private void onViewButtonClicked() {