RecyclerView and async Loading
<p>I have a slight problem. Need a nudge in the right direction. 
I am doing a video editor like Vine and/or instagram. Where they show a timeline with screencaps from the video
<a href="https://i.stack.imgur.com/Snsff.png" rel="noreferrer"><img src="https://i.stack.imgur.com/Snsff.png" alt="enter image description here"></a></p>

<p>It just adds more pictures depending on the videos duration. What i did for my app is that i added a recyclerView. This recyclerview has an adapter that calls the following function every time onBindViewHolder</p>

<pre><code>  public Bitmap getFrameFromCurrentVideo(int seconds) {
    Bitmap bitmap = null;
    if(mMediaMetadataRetriever != null) {
      bitmap = mMediaMetadataRetriever.getFrameAtTime(seconds * 1000000, MediaMetadataRetriever.OPTION_CLOSEST);
    }
    return bitmap;
  }
</code></pre>

<p>This works and it adds the proper amount of images that i want. But the problem is that it is too heavy on the UI thread. Since the recyclerView is recycling everything. It then lags up every time it has to get a frame.</p>

<p>So i thought that i have to do some async task and then cache the images. But what i read is that AsyncTask is not recommended for recycler views since it recycles. </p>

<p>So what should i do to enchance the performance? Any good idea?</p>