user6747491
user6747491

Reputation:

MVP in Android - How to Exchange data/events between Presenters?

I am wondering how you do exchange data or/and events between Presenters in Model-View-Presenter architecture.

I have Activity(View) and Presenter for this View, and Dialog(View) and Presenter for this View. When Activity shows Dialog, Dialog's Presenter is injected to Dialog. I am doing something in Dialog (input text) and submit. This text is seted in presenter, and ... exactly. How to pass this data from Dialog's Presenter to Activity's Presenter?

I used Bus Event (Otto form Square) to send data, but if it is good practice?

Upvotes: 0

Views: 675

Answers (1)

artkoenig
artkoenig

Reputation: 7257

The solution is simple - it is the "M" in "MVP". Use your model to sync your data across the presenters. If you need a notifier for data changes, there are plenty of possible solutions:

Upvotes: 0

Related Questions