diff --git a/docs/html/guide/components/bound-services.jd b/docs/html/guide/components/bound-services.jd index c2ac6074aaec3..f71ba8736be25 100644 --- a/docs/html/guide/components/bound-services.jd +++ b/docs/html/guide/components/bound-services.jd @@ -15,7 +15,11 @@ parent.link=services.html
  • Using a Messenger
  • -
  • Binding to a Service
  • +
  • Binding to a Service +
      +
    1. Additional notes
    2. +
    +
  • Managing the Lifecycle of a Bound Service
  • @@ -309,8 +313,11 @@ public class BindingActivity extends Activity { android.content.ServiceConnection#onServiceConnected onServiceConnected()} callback. The next section provides more information about this process of binding to the service.

    -

    Note: The example above doesn't explicitly unbind from the service, -but all clients should unbind at an appropriate time (such as when the activity pauses).

    +

    Note: In the example above, the +{@link android.app.Activity#onStop onStop()} method unbinds the client from the service. Clients +should unbind from services at appropriate times, as discussed in +Additional Notes. +

    For more sample code, see the {@code @@ -538,10 +545,11 @@ onServiceConnected()} callback method, you can begin making calls to the service the methods defined by the interface.

  • To disconnect from the service, call {@link android.content.Context#unbindService unbindService()}. -

    When your client is destroyed, it will unbind from the service, but you should always unbind -when you're done interacting with the service or when your activity pauses so that the service can -shutdown while its not being used. (Appropriate times to bind and unbind is discussed -more below.)

    +

    If your client is still bound to a service when your app destroys the client, destruction +causes the client to unbind. It is better practice to unbind the client as soon as it is done +interacting with the service. Doing so allows the idle service to shut down. For more information +about appropriate times to bind and unbind, see Additional Notes. +

  • @@ -591,7 +599,7 @@ and {@link android.content.Context#BIND_NOT_FOREGROUND}, or {@code 0} for none.< -

    Additional notes

    +

    Additional notes

    Here are some important notes about binding to a service: