How to manage MultiThreading in an MVP template for Android development?

Recently, I am trying to use MVPPattern in my Android project.

I know that I cannot execute business logic in a layer View. Viewmust deliver all work to a level Presenter, and then wait for the result from Presenter.

Viewshould do anything in the user interface thread. But Presentercan do something in Sub-Thread.

How to manage multithreading in layout Viewand Preseneter?

Any help would be greatly appreciated.

+4
source share
2 answers

You have two directions that you need to communicate:

a) non-user interface thread to UI

and

b) , UI.

runOnUiThread()

:

http://www.intertech.com/Blog/android-non-ui-to-ui-thread-communications-part-1-of-5/

, , . . Presenter " ":

http://developer.android.com/guide/components/fragments.html

, , . , 50 .

+1

Android ( Presenter). , , MVP . . , - .

, , , , .

0

All Articles