Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

android onServiceConnected() is called in a separate thread?

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?

like image 826
pree Avatar asked Nov 04 '13 23:11

pree


1 Answers

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.

like image 125
David Wasser Avatar answered Oct 17 '22 00:10

David Wasser