I have a Recyclerview that shows a list of foods, each row of the recyclerview has 2 buttons, one for quantity of the food and the other to decrease the quantity of the food, graphically there is something like this:
Coca-Cola Price: 10.00 - 0 + Fanta Price: 8.00 - 0 +
That would be the Recyclerview I want that each person of the button to keep the food, the amount they have currently put and their price.
Then pass it to collect showing a receipt.
How to save in real time each time the person gives + a meal the food, its quantity and its price.
So far I have this
holder.botonMasComida.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
holder.tvCantidadComida.setText("" + (cantidadComida = cantidadComida + 1));
RestaurantDetalle.agregarComida(mealList.get(position).getName());
}
});
Activity
static public void agregarComida(String comida){
listaComida.add(comida);
}