title: RecyclerView: How to load items only when the user has stopped scrolling?
body: <p>Currently, I'm developing a launcher app. The app has to load all icons into memory. In some older devices, when I load the app icons through the <code>PackageManager</code>, the app crashes. That's why I'm currently loading icons in the <code>onBindViewHolder(...)</code> method of <code>RecyclerView</code> in a background thread:</p>
  
  <pre><code>@Override
  public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
      // ...
  
      Thread t = new Thread(new Runnable() {
          @Override
          public void run() {
              try {
                  handler.postAtFrontOfQueue(new Runnable() {
                      Drawable drawable = activity.getPackageManager().getApplicationIcon(app.name.toString());
  
                      @Override
                      public void run() {
                          viewHolder.appIconIv.setImageDrawable(drawable);
                      }
                  });
              } catch (PackageManager.NameNotFoundException e) {
                  e.printStackTrace();
              }
          }
      });
      t.start();
  
      // ...
  }
  </code></pre>
  
  <p>But, the problem here is, the <code>RecyclerView</code> stutters/lags while scrolling even though the icons are being loaded in the background. Plus, if I scroll to the bottom, all the icons are loaded into memory causing the app to crash on older devices (with less RAM). Besides, I don't think this is a good solution as it has to create a new thread for every single <strong>binding</strong> of the views. So, my question is, whether it is possible to know if the user has stopped scrolling (and only load icons then).</p>
  
  <blockquote>
    <p>Any help regarding any of the issues I mentioned apart from the main question is <strong>really really</strong> appreciated and I'll be really grateful. [ specially all those performance/RAM issues :( ]</p>
  </blockquote>
  
  <p>Thanks in advance. :D</p>