Also:
Those two calls represents two patterns of interacting with a service.
One is to get a binding, and issue commands via the binding's methods.
The other is to issue commands with Intents, that are handed to the
service in its onStartCommand.
-- Kostya
22.10.2010 22:50, Mark Murphy пишет:
On Fri, Oct 22, 2010 at 2:46 PM, doug<[email protected]> wrote:
Here is what the SDK doc says about the bindService():
"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()."
This means that the Service creation lifecyle events are different
depending on whether or not the service is created out of
startService() or bindService(). Why such difference?
Because one is starting and one is binding. They are two distinct
operations, akin to starting an activity (onCreate()) versus bringing
an existing activity back to the foreground (onNewIntent()).
--
Kostya Vasilyev -- WiFi Manager + pretty widget -- http://kmansoft.wordpress.com
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en