"If someone calls
Context.startService()
then the system will retrieve the service (creating it and calling its onCreate()
method if needed) and then call its onStartCommand(Intent, int, int)
method with the arguments supplied by the client."But wait:
"Clients can also use
Context.bindService()
to obtain a persistent connection to a service. This likewise creates the service if it is not already running (calling onCreate()
while doing so), but does not call onStartCommand()."So, the life-cycle events on Service creation do not occur in a consistent way! No explanation was given. Sigh...
No comments:
Post a Comment