سلام
من یه recyclerView دارم که داخلش یه سری editText هست
مشکلم اینه که وقتی روی editTextها کلیک میکنم این ارور رو میده:
من یه recyclerView دارم که داخلش یه سری editText هست
مشکلم اینه که وقتی روی editTextها کلیک میکنم این ارور رو میده:
java.lang.IllegalArgumentException: parameter must be a descendant of this viewاین هم کد آداپترم:
public class ZaribAdapter extends RecyclerView.Adapter<ZaribAdapter.viewHolder> { List<TblZarayeb> zarayebs; AssetManager as; Typeface font; Context context; public ZaribAdapter( List<TblZarayeb> zarayebs , Context context) { this.zarayebs = zarayebs; this.context = context; } @Override public ZaribAdapter.viewHolder onCreateViewHolder(ViewGroup parent, int viewType) { as = parent.getContext().getAssets(); font = Typeface.createFromAsset(as,"font/iransans_ultralght.ttf"); View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.recycler_zarib_items,parent,false); return new viewHolder(view); } @Override public void onBindViewHolder(ZaribAdapter.viewHolder holder, int position) { holder.txtFaslOnvan.setText(zarayebs.get(position).getFaslOnvan()); holder.txtZaribCode.setText(zarayebs.get(position).getFaslCode()); holder.edtZaribPishnahadi.setText(String.valueOf(zarayebs.get(position).getZpishnehadi())); holder.edtZaribMantaqei.setText(String.valueOf(zarayebs.get(position).getzMantaghe())); holder.edtZaribBalasari.setText(String.valueOf(zarayebs.get(position).getzBalaSari())); holder.edtZaribEkhtiari1.setText(String.valueOf(zarayebs.get(position).getZ1())); holder.edtZaribEkhtiari2.setText(String.valueOf(zarayebs.get(position).getZ2())); } @Override public int getItemCount() { return zarayebs.size(); } public class viewHolder extends RecyclerView.ViewHolder{ TextView txtZaribCode, txtFaslOnvan; TextInputEditText edtZaribPishnahadi, edtZaribMantaqei, edtZaribBalasari, edtZaribEkhtiari1, edtZaribEkhtiari2; ViewParent parent,parent2,parent3,parent4,parent5; public viewHolder(View itemView) { super(itemView); txtFaslOnvan = (TextView)itemView.findViewById(R.id.txtFaslOnvan); txtZaribCode = (TextView)itemView.findViewById(R.id.txtZaribCode); edtZaribPishnahadi = (TextInputEditText)itemView.findViewById(R.id.edtZaribPishnahadi); edtZaribMantaqei = (TextInputEditText)itemView.findViewById(R.id.edtZaribMantaqei); edtZaribBalasari = (TextInputEditText)itemView.findViewById(R.id.edtZaribBalasari); edtZaribEkhtiari1 = (TextInputEditText)itemView.findViewById(R.id.edtZaribEkhtiari1); edtZaribEkhtiari2 = (TextInputEditText)itemView.findViewById(R.id.edtZaribEkhtiari2); txtZaribCode.setTypeface(font); txtFaslOnvan.setTypeface(font); edtZaribEkhtiari2.setTypeface(font); edtZaribEkhtiari1.setTypeface(font); edtZaribBalasari.setTypeface(font); edtZaribMantaqei.setTypeface(font); edtZaribPishnahadi.setTypeface(font); } } }