2

Possible Duplicate:
How to get thumbnail for video in my /sdcard/Android/data/mypackage/files folder ?

Hello All

In my android application i am recording a video and saving this in sdcard. Now what i require is display this video as thumbnails in my application.

I tried all solutions from Android: Is it possible to display video thumbnails? The issue is i need the video from sdcard path and am not understanding as how to get it.

I tried below code

int id = **"The Video's ID"** 
ImageView iv = (ImageView ) convertView.findViewById(R.id.imagePreview); 
ContentResolver crThumb = getContentResolver(); 
BitmapFactory.Options options=new BitmapFactory.Options(); 
options.inSampleSize = 1; 
Bitmap curThumb = MediaStore.Video.Thumbnails.getThumbnail(crThumb, id,MediaStore.Video.Thumbnails.MICRO_KIND, options); 
iv.setImageBitmap(curThumb);

But could not understand as how to get the video from sdcard path.

Please share your valuable suggestions

Thanks in advance :)

Community
  • 1
  • 1
Remmyabhavan
  • 1,689
  • 5
  • 36
  • 65

1 Answers1

0

You can check out ThumbnailUtils as per this answer, provided you are on Android 8 (Froyo) or later.

Community
  • 1
  • 1
Matthew
  • 44,826
  • 10
  • 98
  • 87