Android onServiceConnected () being called in a separate thread?

I was looking for a clear answer for this, but could not find it anywhere. When an android application tries to establish a connection to a service and implements the ServiceConnection (onServiceConnected () and onServiceDisconnected ()) methods, do these callback functions perform in a separate thread or in the main user interface thread? Any idea?

+6
source share
1 answer

These methods are called in the main thread. The documentation for ServiceConnection clearly states that:

Like many callbacks from the system, methods of this class are called from the main thread of your process.

+6
source

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


All Articles