Working on a very small project. Don't plan to add...
# android-architecture
s
Working on a very small project. Don't plan to add DI for now. Is it okay to pass
context
to Presenter in MVP?
u
anything is fine if you dont create memory leaks
👍 1
s
Thanks
g
Strictly speaking a presenter should be platform agnostic thus no context. Most of the times it won’t matter as you won’t reuse the presenter in another platform unless you are doing Kotlin Multiplatform.
☝️ 1
e
If you want to apply a stregth MVP, you should not pass any android or view stuff to the presenter
l
Or you could use AndroidViewModel, which is a subclass of ViewModel and has a fun called getApplication See: https://developer.android.com/reference/androidx/lifecycle/AndroidViewModel