Search code examples
androidmvp

Android mvp startService in model


How can I start a service from a model, if it needs a context.

My problem is, that the view and model do not know anything about each other.

Tell me, if i must use other pattern.


Solution

  • The thing is, View could interact with presenter through interface and presenter with model, so having to start with a presenter is not a bad one. I suggest you to start service from presenter which had context passed from view and has access with model.

    Try giving a read to this article :

    Link Here