Bound Service Lifecycle: Config Changes and Multiple Clients

Tests deep knowledge of bound service lifecycles. A config change causes an unbind/rebind cycle, recreating the service. With multiple clients, the service isn't destroyed until the last one unbinds. Red flag: assuming the service survives the config change.
Tests your understanding of bound service lifecycles versus client lifecycles. A great answer explains that a config change destroys the Activity, which unbinds and destroys the service. The new Activity instance then re-binds, creating a new service. For multiple clients, the service tracks a connection count and is only destroyed after the final client unbinds. Red flag: stating the service survives the config change because the system 'knows' the Activity is returning.
Read the original → developer.android.com
- #android
- #service
- #lifecycle
- #architecture
Get five bites like this every day.
Tezvyn delivers a daily feed of 60-second tech bites with quizzes to lock in what you learn.