title: RecyclerView is creating ViewHolders for all items at once
body: <p>I have main RecyclerView which contains other RecyclerViews (let's call them subRecyclerViews). The number of subRecyclerViews is based on the data received from server. The problem is, that whenever a subRecyclerView is about to become visible, it creates ViewHolders for all its items at once (instead of creating ViewHolders only for visible items).</p>
  
  <p>In my MainRecyclerViewAdapter onBindViewHolder() method I call </p>
  
  <pre><code>subRecyclerViewAdapter.setData(data);
  subRecyclerView.notifyDataSetChanged();
  </code></pre>
  
  <p>which results in a lag, because the subRecyclerView is calling onCreateViewHolder() and onBindViewHolder() methods for all its items.</p>
  
  <p>The version of RecyclerView I use is</p>
  
  <pre><code>com.android.support:recyclerview-v7:25.1.1
  </code></pre>
  
  <p>The question is, is there a way to tell subRecyclerView that it doesn't need to create ViewHolders for the items, that are not yet visible? Also, is this a bug in RecyclerView or am I doing something wrong?</p>