+ Bitmap thumbnail = null;
+ if (file.isImage()) {
+ String tagId = String.valueOf(file.getRemoteId());
+ thumbnail = ThumbnailsCacheManager.getBitmapFromDiskCache(tagId);
+ }
+ if (thumbnail != null) {
+ // Display thumbnail
+ iv.setImageBitmap(thumbnail);
+ } else {
+ // Name of the file, to deduce the icon to use in case the MIME type is not precise enough
+ String filename = file.getFileName();
+ iv.setImageResource(MimetypeIconUtil.getFileTypeIconId(mimetype, filename));
+ }