title: Android - Display a video thumbnail from a URL
body: <p>I need to display a video thumbnail based to a <strong>URL</strong> into an <code>ImageView</code> view child of my <code>ListView</code> items, i have found this <a href="https://stackoverflow.com/questions/13743223/it-is-possible-to-display-a-video-thumbnail-from-a-url-on-android-4-and-above">post</a> but not worked.</p>
  
  <p><strong>Result</strong></p>
  
  <p><img src="https://i.stack.imgur.com/ZFeyZ.png" alt="enter image description here"></p>
  
  <p><strong>Code</strong></p>
  
  <pre><code>        thumb_image.setImageBitmap(new LoadVideoThumbnail().execute(URLs.videos +"/"+videos.get(position).getId()+".mp4").get());
  </code></pre>
  
  <p><strong>AsyncTask</strong></p>
  
  <pre><code>public class LoadVideoThumbnail extends AsyncTask&lt;String, Object, Bitmap&gt;{
  
          @Override
          protected Bitmap doInBackground(String... objectURL) {
              //return ThumbnailUtils.createVideoThumbnail(objectURL[0], Thumbnails.MINI_KIND);
              return ThumbnailUtils.extractThumbnail(ThumbnailUtils.createVideoThumbnail(objectURL[0], Thumbnails.MINI_KIND), 100, 100);
          }
  
          @Override
          protected void onPostExecute(Bitmap result){
               //img.setImageBitmap(result);
          }
  
      }
  </code></pre>