我的回收者视图未显示所有图像和文本,仅显示了最后一张图像和名称为“ arraylist.size”的时间

我的Recycler视图包含在ArrayList中的图像和名称中,它与包含所有图像和名称的ArrayList并没有特别显示,而最后一个图像和名称的显示时间为“ ArrayList.size”,就像我输入四个图像和四个名称一样,所以最后一个输入图像和最后输入的名称在回收器视图中显示四次。

fragment.java类:

public class Revfragment extends Fragment {

    public Revfragment() {
        // Required empty public constructor
    }
    ArrayList<gettersetter> arrayList = new ArrayList<>();
    CustomeAepter customeAepter;
    RecyclerView recyclerView;
    String  name[] = {"kishan","karan","jigar","raman"};
    int img[] = {R.drawable.a,R.drawable.ad,R.drawable.ac,R.drawable.ab};

    RecyclerView.LayoutManager manager;
    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
       initDataset();
    }

    private void initDataset() {
        for (int i = 0; i < name.length; i++) {
        gettersetter gettersetter = new gettersetter(img[i], name[i]);
        arrayList.add(gettersetter);
    }

    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        // Inflate the layout for this fragment
        View rootview= inflater.inflate(R.layout.fragment_revfragment, container, false);
        recyclerView = rootview.findViewById(R.id.revs);
        manager = new LinearLayoutManager(getActivity());
        customeAepter = new CustomeAepter(getActivity(),arrayList);
       recyclerView.setAdapter(customeAepter);
        recyclerView.setLayoutManager(manager);
       return rootview;

    }
}

转接器类别

public class CustomeAepter extends RecyclerView.Adapter<CustomeAepter.myclass> {

    TextView textView;
    ImageView imageView;

    ArrayList<gettersetter> arrayList;
   Context context;


    public CustomeAepter(Context cotexts,ArrayList<gettersetter> arrayLists) {
        arrayList = arrayLists;
        context = cotexts;
    }


    @NonNull
    @Override
    public CustomeAepter.myclass onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
     View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.textitem,parent,false);
        return new myclass(v);
    }

    @Override
    public void onBindViewHolder(@NonNull CustomeAepter.myclass holder, int position) {
        holder.getTextView().setText(gettersetter.getName());
        holder.getImageView().setImageResource(gettersetter.getImg());
    }

    @Override
    public int getItemCount() {
        return arrayList.size();
    }

    public class myclass extends RecyclerView.ViewHolder {
        public myclass(@NonNull View itemView) {
            super(itemView);
            textView = itemView.findViewById(R.id.txt);
           imageView = itemView.findViewById(R.id.img);
        }

        public TextView getTextView() {
            return textView;
        }
        public ImageView getImageView()
        {
            return imageView;
        }
    }
}

fragment show this type of recycler view show Image