The model is responsible for the data that will be displayed in the user interface. We could consider as a model, besides the data, any logic of manipulation and access of this data.
The view, normally implemented by a Activity
(can also be a Fragment
or any UI element, depending on the structure of your application), will contain a reference to the presenter. The presenter can be created by Activity or supplied via dependency injection. The sole responsibility of the View is to call methods in the Presenter every time the user interacts with it.
The presenter acts as an intermediary between the view and the model. It takes data from the model and returns to the view. But, unlike typical MVC, it also decides what happens when user interacts with the view.
These definitions above were taken from article by Antonio Leiva.
As for the methods onRequestPermissionsResult
, OnClickListener
, onActivityResult
; shall be maintained in their respective activities or fragments, forming part of the view in relation to MVP, which are also in Android’s own classes. Already the method listenerTvAddDetalhesRotulo
, which you probably invented, depending on the context, you can get into presenter or model.
If you are interested in good practices when it comes to Android, I recommend reading Best Practices in Android.
You have no alternative but to leave them in Activity. You can/You must delegate the answer to them to code in the Presenter.
– ramaral