samedi 9 mai 2020

MVP Android: how to pass data from one activity to another?

I have the following doubt and I'm wondering if this breaks or not the MVP pattern.

My project has Activity1 where an user can fill a form and then the presenter, related to that activity, on a button click retrieves data from a database based on the information given by the user and put it into a list.

Activity2 has the job to display the objects of this list.

Is it ok (according to MVP) that Activity1 put the list into an Intent and then start Activity2 with that Intent? (I don't think so).

Should the presenter of the Activity1 pass the list to the presenter of the Activity2? But how can this be done if presenters can't communicate each other?

Aucun commentaire:

Enregistrer un commentaire