mirror of
https://github.com/moparisthebest/k-9
synced 2024-12-24 08:38:51 -05:00
Close stream when done (StrictMode error).
This commit is contained in:
parent
fce39f0fce
commit
2df436e7bc
@ -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() {
|
||||
|
Loading…
Reference in New Issue
Block a user