Note: You don't usually bind and unbind during your activity's onResume() and onPause(), because these callbacks occur at every lifecycle transition and you should keep the processing that occurs at these transitions to a minimum.
Nota: Generalmente, no debes realizar ni deshacer enlaces durante onResume() y onPause() de tu actividad, ya que estos callbacks tienen lugar en todas las transiciones del ciclo de vida y debes minimizar al máximo el procesamiento que se produce en esas transiciones.
If you need to interact with the service only while your activity is visible, you should bind during on Start() and unbind during onStop().
Si solo debes interactuar con el servicio mientras tu actividad esté visible, debes establecer el enlace durante onStart() y deshacerlo durante onStop().
If you want your activity to receive responses even while it is stopped in the background, then you can bind during onCreate() and unbind during onDestroy().
Si quieres que tu actividad reciba respuestas aunque esté detenida en segundo plano, puedes establecer el enlace durante onCreate() y desenlazar durante onDestroy().
If you need to interact with the service only while your activity is visible, you should bind during on Start() and unbind during onStop().
El ciclo de vida completo de un servicio transcurre entre el momento en el que se llama a onCreate() y el momento en el que se muestra onDestroy().
If you want your activity to receive responses even while it is stopped in the background, then you can bind during onCreate() and unbind during onDestroy().
Los métodos onCreate() y onDestroy() reciben llamadas para todos los servicios, independientemente de que se hayan creado a través de startService() o bindService().
Conținut posibil inadecvat
Exemplele au rolul de a te ajuta să traduci cuvinte sau expresii corect si adaptat la context. Nu sunt selectate sau validate manual, așadar pot conține termeni inadecvați. Te rugăm să raportezi exemplele pe care le consideri inadecvate. Traducerile vulgare sau colocviale sunt în general marcate cu roșu sau cu portocaliu.