Dudas sobre bindService
Tengo algunas dudas sobre el servicio vinculado a Android. La guía:http://developer.android.com/guide/components/bound-services.html ,acerca debindService()
, dice:
The `bindService()` method returns immediately without a value
Pero esto no parece ser correcto, ya queaquí la firma del método es
public abstract boolean bindService (Intent service, ServiceConnection conn, int flags)
donde el valor booleano devuelto se describe a continuación:
If you have successfully bound to the service, true is returned; false is returned if the connection is not made so you will not receive the service object.
Entonces la pregunta es: ¿por qué la documentación dice que el métodoreturns immediately without a value
? Además,aquí, el enlace se realiza de esta manera:
void doBindService() {
bindService(new Intent(Binding.this,
LocalService.class), mConnection, Context.BIND_AUTO_CREATE);
mIsBound = true;
}
y no entiendo el sentido demIsBound = true
, ya que el javadoc dice que bindService () también puede devolver falso, si falla la conexión al servicio. Entonces debería ser:
void doBindService() {
mIsBound = bindService(new Intent(Binding.this,
LocalService.class), mConnection, Context.BIND_AUTO_CREATE);
}
¿Me equivoco?