antoniolg / androidmvp

MVP Android Example
5.94k stars 1.58k forks source link

Force interactor callback to run on main thread #14

Closed wsxyeah closed 8 years ago

antoniolg commented 8 years ago

I agree it's not a bad idea if you are going to do something in another thread inside the handler, but the handler there is just to mock a delay to the responses, it's not part of the MVP architecture at all, so I don't think it adds much to the example.

I wouldn't advise to use a handler like that on a real app (and less with a fake delay 😄 ).

DoingLee commented 8 years ago

so, if I want to do something in another thread and show the result in ui thread, which layer should I put the handler? It would be better if you made a description in the demo. Thank you ~

antoniolg commented 8 years ago

I would do it in the interactor.