@Override public void onBindViewHolder(CrimeHolder holder, int position) { // Get the crime that is at the index declared by the variable position // and assign it to a local crime variable Crime crime = mCrimes.get(position); // Send the crime over to the bindCrime method that we wrote on // the crimeholder class. That method does the work of setting // the properties of the crime to the layout controls in the // custom layout we made. holder.bindCrime(crime); }
/** * This method will bind a ViewHolder's View to your model object. It receives the ViewHolder * and a position in your data set. To bind your View, you use that position to find the right * model data. Then you update the View to reflect that model data. * * @param crimeHolder * @param i */ @Override public void onBindViewHolder(CrimeHolder crimeHolder, int i) { Crime crime = mCrimes.get(i); crimeHolder.bindCrime(crime); }
@Override public void onBindViewHolder(CrimeHolder holder, int position) { Crime crime = mCrimes.get(position); holder.bindCrime(crime); }