Android: Get thumbnail of image on SD card, given Uri of original image

android, image, thumbnails, uri

Solution

You can simply create thumbnail video and image using ThumnailUtil class of java

Bitmap resized = ThumbnailUtils.extractThumbnail(BitmapFactory.decodeFile(file.getPath()), width, height);


 public static Bitmap createVideoThumbnail (String filePath, int kind)

Added in API level 8 Create a video thumbnail for a video. May return null if the video is corrupt or the format is not supported.

Parameters filePath the path of video file kind could be MINI_KIND or MICRO_KIND

For more Source code of Thumbnail Util class

Developer.android.com

Problem

So i've got a Uri of an image the user chooses out of images off his SD card. And i'd like to display a thumbnail of that image, because obviously, the image could be huge and take up the whole screen. Anyone know how?

Original source

Related problems