In the MVP pattern who is responsible to handle clicks on the UI?
E.g. the non-MVP approach would be something like:
counterButton.setOnClickListener(n
In MVP, it is the responsibility of the View to know how to capture the click, not to decide what to do on it. As soon as the View captures the click, it must call the relevant method in the Presenter to act upon it:
------------------- View --------------------
button1.setOnClickListener(new OnClickListener({
presenter.doWhenButton1isClicked();
}));
------------------ Presenter ----------------
public void doWhenButton1isClicked(){
// do whatever business requires
}
I have a series of articles on architectural patterns in android, part 3 of which is about MVP. You might find it helpful.