title: How to detect each RecyclerView item after it is displayed
body: <p>I want to detect each item in my <a href="https://developer.android.com/guide/topics/ui/layout/recyclerview" rel="noreferrer">RecylerView</a> after it is displayed to the user.</p>
  
  <p>Basically, I am trying to play a sound on each item after it is loaded on the screen. </p>
  
  <p>But I am not able to detect whenever each item is loaded on the screen! Is there any method I have to call to detect each item rendered</p>
  
  <pre><code>E.g 1st RecyclerView item displayed -&gt; play sound
      2st RecyclerView item displayed -&gt; play sound...
  </code></pre>
  
  <p>My Adapter class looks like this -</p>
  
  <pre><code>public class AdapterListAnimation extends RecyclerView.Adapter&lt;RecyclerView.ViewHolder&gt; {
  
      private List&lt;Multiples&gt; items = new ArrayList&lt;&gt;();
  
      private Context ctx;
      private OnItemClickListener mOnItemClickListener;
      private int animation_type = 0;
      .........
      .........
  </code></pre>
  
  <p>I am calling this <code>initComponent()</code> method from <code>onCreated()</code> method. Can you give advice on what should I do to achieve my goal as described above?</p>
  
  <pre><code>private void initComponent() {
      recyclerView = (RecyclerView) findViewById(R.id.recyclerView);
      recyclerView.setLayoutManager(new LinearLayoutManager(this));
      recyclerView.setHasFixedSize(true);
      items = DataGenerator.getPeopleData(this,of,value);
      setAdapter();
  
      /* MediaPlayer mp=MediaPlayer.create(this, R.raw.sword);
      if (mp.isPlaying()) {
          mp.stop();
          mp.release();
          mp = MediaPlayer.create(this, R.raw.sword);
      } mp.start();*/
  }
  
  private void setAdapter() {
      // Set data and list adapter
      mAdapter = new AdapterListAnimation(this, items, animation_type);
      recyclerView.setAdapter(mAdapter);
  
      // on item list clicked
      mAdapter.setOnItemClickListener(new AdapterListAnimation.OnItemClickListener() {
          @Override
          public void onItemClick(View view, com.math.multiplication.model.Multiples obj, int position) {
              Snackbar.make(parent_view, "Item " + obj.first + " clicked", Snackbar.LENGTH_SHORT).show();
          }
      });
  }
  </code></pre>