java - How to display Video thumbnail in ImageView? -


I want to display my video thumbnail immediately after taking the video.

This is my current code on the OnActivityResult method

  if (requestCode == 101) {bitmap bmThumbnail = ThumbnailUtils.createVideoThumbnail ("/ storage / emulated / 0 / myvideo.mp4 ", MediaStore.images thumbnails.MICRO_KIND); ViewImage.setImageBitmap (bmThumbnail); }  

But this image does not display anything on the scene.

Any workaround for this?

* Update: Fixed

I changed the code to:

  if (requestcode == 101) {bitmap BMT-thumbnail = Thumbnail Answer.Scent Videography (f.getAbsolutePath (.) ToString (), MediaStore.Embages.Thumbnails.MINI_KIND); ViewImage.setImageBitmap (bmThumbnail); }  

Now showing thumbnails and I have a big size, which is acceptable to watch. Thanks for the Sassa

I have retrieved the entire path of the file using only f.GetAbsolutePath:

  if (requestcode == 101) {bitmap bmtmbluelan = thumbnail answer Break the tabanal (F.A.T.SSOoluthpath (.) ToString (), MediaStore.images.thumbnail.min_kind); ViewImage.setImageBitmap (bmThumbnail); }  

Comments