title: RecyclerView retrieves data from last position
body: <p>I have a RecyclerView with certain data, and each recyclerView item has a button that launch a second activity. 
  In the second activity it should display values from the specific item from which button is clicked.
  The problem here is that when I press the button from the item in position 0, I have the correct values, but when I press button in position 1, I get the values from position 0:</p>
  
  <p>button at position 2 - displays values from position 1</p>
  
  <p>button at position 3 - displays values from position 2</p>
  
  <p>button at position 4 - displays values from position 3</p>
  
  <p>and so on...</p>
  
  <p>This is the method where I populate the ViewHolder() and the onClick event:</p>
  
  <pre><code>protected void populateViewHolder(PicturesHolder viewHolder, Pictures model, final int position) {
  
                  viewHolder.setImage(model.getDownloadURL());
                  viewHolder.setLatitude(model.getLatitude());
                  viewHolder.setLongitude(model.getLongitude());
                  viewHolder.setDateView(model.getDate());
  
                  viewHolder.imageButtonView.setOnClickListener(new View.OnClickListener(){
                      @Override
                      public void onClick(View view){
                          Toast.makeText(view.getContext(), "Launching second activity", Toast.LENGTH_SHORT).show();
                          Intent intent = new Intent(view.getContext(),DetailsActivity.class);
                          TextView latitude = (TextView) findViewById(R.id.latitude);
                          TextView longitude = (TextView) findViewById(R.id.longitude);
                          String latitude_details = latitude.getText().toString();
                          String longitude_details = longitude.getText().toString();
                          intent.putExtra(EXTRA_LATITUDE,latitude_details);
                          intent.putExtra(EXTRA_LONGITUDE,longitude_details);
                          startActivity(intent);
                      }
                  });
              }
  </code></pre>
  
  <p>This is the SecondActivity where data is displayed:</p>
  
  <pre><code>public class DetailsActivity extends AppCompatActivity {
  
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_details);
  
          Intent intent=getIntent();
          String mLatitude = intent.getStringExtra(MainActivity.EXTRA_LATITUDE);
          String mLongitude = intent.getStringExtra(MainActivity.EXTRA_LONGITUDE);
  
          TextView latitude = (TextView) findViewById(R.id.latitude_detail);
          TextView longitude = (TextView) findViewById(R.id.longitude_detail);
  
          latitude.setText(mLatitude);
          longitude.setText(mLongitude);
  
      }
  }
  </code></pre>
  
  <p>I don't know what I'm doing wrong, if you need more code don't hesitate in asking.
  Thank you and greetings!</p>