Книга: Beginning Android

Prometheus Unbound

Prometheus Unbound

When you are done with the IPC interface, call unbindService(), passing in the ServiceConnection. Eventually, your connection’s onServiceDisconnected() callback will be invoked, at which point you should null out your interface object, disable relevant widgets, or otherwise flag yourself as no longer being able to use the service.

For example, in the WeatherPlus implementation of onServiceDisconnected() shown previously, we null out the IWeather service object.

You can always reconnect to the service, via bindService(), if you need to use it again.

Оглавление книги


Генерация: 3.757. Запросов К БД/Cache: 3 / 1
поделиться
Вверх Вниз