این کدهایی که زدم
import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; import androidx.annotation.NonNull; import androidx.recyclerview.widget.RecyclerView; class ContactsAdapter extends RecyclerView.Adapter{ private String[] contacts=new String[20]; public void contactsadapter(){ contacts[0]="ashly young"; contacts[1]="Peadar Dawtrey"; contacts[2]="Felipe Bradtke"; contacts[3]="Claude Crissil"; contacts[4]="Jacky Girardeau"; contacts[5]="Rubia Dominguez"; contacts[6]="Michaela Churchley"; contacts[7]="Harvey Pentelow"; contacts[8]="Neilla Langton"; contacts[9]="Marco Greaves"; contacts[10]="Liz Batchley"; contacts[11]="Lamond Littlepage"; contacts[12]="Malina Weir"; contacts[13]="Tomlin Lenchenko"; contacts[14]="Hy Pavelin"; contacts[15]="Jenelle Palin"; contacts[16]="Damon Knewstubb"; contacts[17]="Alex Ivanusyev"; contacts[18]="Hamil Callery"; contacts[19]="Karol Syer";} private TextView fullnameTv; private TextView firstcharTv; @NonNull @Override public ContactViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { View view=LayoutInflater.from(parent.getContext()).inflate(R.layout.item_contact , parent , false); return new ContactViewHolder(view); } @Override public void onBindViewHolder(@NonNull ContactViewHolder holder, int position) { holder.bincontacts(contacts[position]); } @Override public int getItemCount() { return contacts.length; } public class ContactViewHolder extends RecyclerView.ViewHolder{ public ContactViewHolder(@NonNull View itemView) { super(itemView); fullnameTv=itemView.findViewById(R.id.tv_cantact_fullname); firstcharTv=itemView.findViewById(R.id.tv_cantact_firstChar); } public void bincontacts(String fullname){ fullnameTv.setText(fullname); firstcharTv.setText(fullname.substring(0,1)); } } }