Bound Service Lifecycle with Config Changes & Multiple Clients

Tests your grasp of bound Service lifecycles. Explain that with BIND_AUTO_CREATE, the Service survives an Activity's config change recreation. It's only destroyed after the *last* client unbinds. A red flag is assuming the Service dies with the first client.
This tests your detailed knowledge of how bound Service lifecycles are coupled to their clients. A great answer explains that BIND_AUTO_CREATE ensures the Service exists, survives the Activity's destruction/recreation during a config change, and is only destroyed by the system after the very last client unbinds. A major red flag is stating the Service is destroyed with the Activity or that any unbind call can trigger onDestroy when other clients are still connected.
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.