Skip list for another Activity

1

I am creating an application, at this point in the application, you choose how many products you will get from a List made with RecyclerView and this list will be passed to another Activity where it will be loaded into a ListView.

I wanted to know what I can use to store the products that the user clicked. I was thinking of using sharedPreference, but each product has a lot of information like description, id, value ... and if it's more than one product, how can I get this information separate? Use HashMap? List

    
asked by anonymous 19.09.2017 / 18:56

1 answer

2

If you just want to pass the selected items to another Activity, save them to a ArrayList<Produto> .

Put this array in Intent with intent.putExtra() .

The Product class must implement the Serializable or Parcelable interface. See how in How to use a Bundle with a non-primitive type?

    
19.09.2017 / 19:36