I have been looking for a clear answer for this, but couldn't find it anywhere. When an android app tries to make a connection with service and implements the ServiceConnection methods (onServiceConnected() and onServiceDisconnected()), do these callback functions run in a separate thread or in the main UI thread? Any idea?
These methods are called on the main thread. The documentation for ServiceConnection
clearly states that:
Like many callbacks from the system, the methods on this class are called from the main thread of your process.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With