1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-12-25 09:08:49 -05: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() { private Bitmap getPreviewIcon() {
Bitmap icon = null;
try { try {
return BitmapFactory.decodeStream( InputStream input = mContext.getContentResolver().openInputStream(
mContext.getContentResolver().openInputStream(
AttachmentProvider.getAttachmentThumbnailUri(mAccount, AttachmentProvider.getAttachmentThumbnailUri(mAccount,
part.getAttachmentId(), part.getAttachmentId(),
62, 62,
62))); 62));
icon = BitmapFactory.decodeStream(input);
input.close();
} catch (Exception e) { } catch (Exception e) {
/* /*
* We don't care what happened, we just return null for the preview icon. * We don't care what happened, we just return null for the preview icon.
*/ */
return null;
} }
return icon;
} }
private void onViewButtonClicked() { private void onViewButtonClicked() {