static class ViewHolder extends RecyclerView.ViewHolder { TextView textView; ViewHolder(View itemView) { super(itemView); textView = itemView.findViewById(R.id.textView); } } @Override public void onBindViewHolder(ViewHolder holder, int position) { holder.textView.setText(data.get(position)); }In the code above, we define a ViewHolder which stores a TextView component of the item view. In the onBindViewHolder method, we set the data for the item view by accessing the ViewHolder's TextView. The package library for ViewHolder would be androidx.recyclerview.widget.