I am working on a simple shopping cart project. Currently, trying to add custom items via onClick from one RecyclerView and have it added to a new seperate ArrayList that will show in the cart RecyclerView. I'm able to add new blank custom objects to the ArrayList but can't seem to figure out how to add the selected item. I tried passing position through a couple of parts none working. Here is the code: <pre> mAdapter.setOnItemClickListener(new MainAdapter.OnItemClickListener() { @Override public void onItemClick(int position) { addToCart(position); } }); } public void addToCart(int position){ cartList.add(new Inventory()); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)