title: onBindViewHolder() is never called on view at position even though RecyclerView.findViewHolderForAdapterPosition() returns null at that position
body: <p>I have a list with 13 items (although items may be added or removed), positions 0-12. When the fragment containing the RecyclerView is first shown, only positions 0 through 7 are visible to the user (position 7 being only half visible). In my adapter I <code>Log</code> every time a view holder is binded/bound (idk if grammar applies here) and record its position.</p>
  
  <p><strong>Adapter</strong>  </p>
  
  <pre><code>@Override
  public void onBindViewHolder(final ViewHolder holder, final int position) {
      Log.d(TAG, "onBindViewHolder() position: " + position);
      ...
  }
  </code></pre>
  
  <p>From my <code>Log</code> I see that positions 0-7 are bound:</p>
  
  <p><a href="https://i.stack.imgur.com/lvYn4.png"><img src="https://i.stack.imgur.com/lvYn4.png" alt="Log from Adapter"></a></p>
  
  <p>I have a <code>selectAll()</code> method that gets each <code>ViewHolder</code> by adapter position. If the returned <code>holder</code> is NOT <code>null</code> I use the returned <code>holder</code> to update the view to show it's selected. If the returned holder IS <code>null</code> I call <code>selectOnBind()</code> a method that flags the view at that position update to show it's selected when it's binded rather than in real time since it's not currently shown:</p>
  
  <pre><code>public void selectAll() {
      for (int i = 0; i &lt; numberOfItemsInList; i++) {
          MyAdapter.ViewHolder holder = (MyAdapter.ViewHolder)
                  mRecyclerView.findViewHolderForAdapterPosition(i);
  
          Log.d(TAG, "holder at position " + i + " is " + holder);
  
          if (holder != null) {
              select(holder);
          } else {
              selectOnBind(i);
          }
      }
  }
  </code></pre>
  
  <p>In this method I <code>Log</code> the <code>holder</code> along with its position:</p>
  
  <p><a href="https://i.stack.imgur.com/AHm9e.png"><img src="https://i.stack.imgur.com/AHm9e.png" alt="Log from selectAll()"></a></p>
  
  <p>So up to this point everything seems normal. We have positions 0-7 showing, and according to the <code>Log</code> these are the positions bound. When I hit <code>selectAll()</code> without changing the visible views (scrolling) I see that positions 0-7 are defined and 8-12 are <code>null</code>. So far so good.</p>
  
  <p>Here's where it gets interesting. If after calling <code>selectAll()</code> I scroll further down the list positions 8 and 9 do not show they are selected. </p>
  
  <p>When checking the <code>Log</code> I see that it's because they are never bound even though they were reported to be <code>null</code>:</p>
  
  <p><a href="https://i.stack.imgur.com/aIl15.png"><img src="https://i.stack.imgur.com/aIl15.png" alt="Adapter Log after scroll"></a></p>
  
  <p>Even more confusing is that this does not happen every time. If I first launch the app and test this it may work. But it seems to happen without fail afterwards. I'm guessing it has something to do with the views being recycled, but even so wouldn't they have to be bound?</p>
  
  <p><strong>EDIT</strong> (6-29-16)<br>
  After an AndroidStudio update I cannot seem to reproduce the bug. It works as I expected it to, binding the null views. If this problem should resurface, I will return to this post.</p>