title: RecyclerView scroll to position and get that view
body: <p>I want to auto scroll a list item to top (firstVisible item) in my recycler view and get the view at that position, so I can highlight it, from my fragment. </p>
  
  <p>So, this is the gist of my fragment code : </p>
  
  <pre><code>    private void activateNewListItem(int position) {
  
         mLayoutManager().scrollToPositionWithOffset(position, 0);
         RecyclerView.ViewHolder viewHolder = mRecyclerView.findViewHolderForLayoutPosition(position);
  
         View view = viewHolder.getItemView();
         view.setBackgroundColor(getResources().getColor(R.color.esr_light_grey));
  }
  </code></pre>
  
  <p>If <code>position</code> is <strong>1</strong>,<strong>2</strong>,<strong>3</strong>,<strong>4</strong> etc, <code>mRecyclerView.findViewHolderForPosition(position)</code>  returns a valid ViewHolder,
   because I guess RecyclerView has drawn ViewHolders for those indexes in dataSet. </p>
  
  <p>However, if I pass in <code>position</code> as say, <strong>25</strong>, <code>mRecyclerView.findViewHolderForPosition(position)</code>  returns null, because I assume, it hasn't been drawn yet, even thoughI called <code>mLayoutManager.scrollToPositionWithOffset(position, 0)</code> above it.   </p>
  
  <p>What can I do to achieve these two things? </p>
  
  <ol>
  <li><p>Scroll the list item of dataSet index <code>position</code> to firstVisibleItem.</p></li>
  <li><p>Get the View or ViewHolder object of that listItem, so I can change the background or whatever.</p></li>
  </ol>