@ Override public void onBindViewHolder ( RecyclerView . ViewHolder viewHolder , int position , List < Object > payloads ) { Object tag = viewHolder . itemView . getTag ( R . id . fastadapter_item_adapter ) ; if ( tag instanceof FastAdapter ) { FastAdapter fastAdapter = ( ( FastAdapter ) tag ) ; IItem item = fastAdapter . getItem ( position ) ; if ( item != null ) { item . bindView ( viewHolder , payloads ) ; if ( viewHolder instanceof FastAdapter . ViewHolder ) { ( ( FastAdapter . ViewHolder ) viewHolder ) . bindView ( item , payloads ) ; } //set the R.id.fastadapter_item tag of this item to the item object (can be used when retrieving the view) viewHolder . itemView . setTag ( R . id . fastadapter_item , item ) ; } } }
is called in onBindViewHolder to bind the data on the ViewHolder