Android MVP – Should avoid using R.string references in presenter?

I consider that there’s no reason to call any android code in Presenter (But you always can do it).

So in your case:

View / activity onCreate() calls -> presenter.onCreate();

Presenter onCreate() calls -> view.setTextLabel() or whatever you want in the view.

Always decouple Android SDK from presenters.

In Github, you can find some examples about MVP:

  • https://github.com/pedrovgs/EffectiveAndroidUI

  • https://github.com/android10/Android-CleanArchitecture

  • https://github.com/PaNaVTEC/Clean-Contacts/tree/develop

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)