public class Orderlist_recyclerview_adapter extends
RecyclerView.Adapter<Orderlist_recyclerview_adapter.MyViewHolder> {
private Context mContext;
private ArrayList<Orderlist_contents_bindingmodel> mUsersList = null;
private LayoutInflater inflater;
public Orderlist_recyclerview_adapter(Context context, ArrayList<Orderlist_contents_bindingmodel> usersList) {
mContext = context;
mUsersList= usersList;
inflater = LayoutInflater.from(mContext);
}
@Override
public MyViewHolder onCreateViewHolder(ViewGroup viewGroup, int i) {
OrderlistAdapterContentsBinding binding = OrderlistAdapterContentsBinding.inflate(inflater);
MyViewHolder myViewHolder = new MyViewHolder(binding);
return myViewHolder;
}
@Override
public void onBindViewHolder(MyViewHolder myViewHolder, int i) {
Orderlist_contents_bindingmodel user = mUsersList.get(i);
myViewHolder.vBinding.setOrderlist_model(user);
}
@Override
public int getItemCount() {
return mUsersList.size();
}
public class MyViewHolder extends RecyclerView.ViewHolder {
OrderlistAdapterContentsBinding vBinding;
public MyViewHolder(OrderlistAdapterContentsBinding binding) {
**super(binding.getRoot());**here is the error
this.vBinding = binding;
}
}
}
I need to know how to associate a recyclerview adapter model with a row layout.
I already announced these things
<data>
<variable name="orderlist_model" type="anpi.com.propuesta.binding_models.Orderlist_contents_bindingmodel" />
</data>
and I have text images, but such errors still occur:
no resource type found with (text=@{..})binding .getroot not found
source
share