Android: looper / handler vs Java Observer?

Are these competitors? I think this is not so, but I do not see it.

What about in the context of the action you need to know when the service has a new xyz?

Thank!

+3
source share
1 answer

They are designed for different purposes, so you cannot compare how one of them excludes the other, as you can assume. I explain:

  • Registered Observers receive notification of a change collectively sequentially, simply by calling once notifyObservers(..).

  • , / 1 "" (, ).

, , , , Observer.

, 5 , Observer; -)

+1

Source: https://habr.com/ru/post/1772562/


All Articles