jeudi 20 juin 2019

Pass object or objects id to new activity

If I have a list of certain items (let's say fruits) in one activity. Here the items are completely loaded from a ROOM database. Clicking on a Fruit should take you to the FruitDetailPage. Ofcourse I have to pass the Fruit to the new activity with an Intent.

But what would be better to do?

  • Pass the complete fruit object
  • Pass the fruit_id and reload the fruit object from the database in the new activity

Aucun commentaire:

Enregistrer un commentaire