Stay organized with collections
Save and categorize content based on your preferences.
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-17 UTC.
[null,null,["Last updated 2025-02-17 UTC."],[],[],null,["# Car.CarServiceLifecycleListener\n===============================\n\n\n`\npublic\nstatic\n\n\ninterface\nCar.CarServiceLifecycleListener\n`\n\n\n`\n\n\n`\n\n|---------------------------------------------|\n| android.car.Car.CarServiceLifecycleListener |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nCallback to notify the Lifecycle of car service.\n\nAccess to car service should happen\nafter [CarServiceLifecycleListener#onLifecycleChanged(Car, boolean)](/reference/android/car/Car.CarServiceLifecycleListener#onLifecycleChanged(android.car.Car,%20boolean)) call with\n`ready` set `true`.\n\nWhen [CarServiceLifecycleListener#onLifecycleChanged(Car, boolean)](/reference/android/car/Car.CarServiceLifecycleListener#onLifecycleChanged(android.car.Car,%20boolean)) is\ncalled with ready set to false, access to car service should stop until car service is ready\nagain from [CarServiceLifecycleListener#onLifecycleChanged(Car, boolean)](/reference/android/car/Car.CarServiceLifecycleListener#onLifecycleChanged(android.car.Car,%20boolean)) call\nwith `ready` set to `true`.\n\n\u003cbr /\u003e\n\nSummary\n-------\n\n| ### Public methods ||\n|------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` abstract void` | ` `[onLifecycleChanged](/reference/android/car/Car.CarServiceLifecycleListener#onLifecycleChanged(android.car.Car,%20boolean))`(`[Car](/reference/android/car/Car)` car, boolean ready) ` Car service has gone through status change. |\n\nPublic methods\n--------------\n\n### onLifecycleChanged\n\n```\npublic abstract void onLifecycleChanged (Car car, \n boolean ready)\n```\n\nCar service has gone through status change.\n\nThis is always called in the main thread context.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Parameters ||\n|---------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `car` | `Car`: `Car` object that was originally associated with this lister from [Car.createCar(android.content.Context, android.os.Handler, long, android.car.Car.CarServiceLifecycleListener)](/reference/android/car/Car#createCar(android.content.Context,%20android.os.Handler,%20long,%20android.car.Car.CarServiceLifecycleListener)) call. \u003cbr /\u003e |\n| `ready` | `boolean`: when `true`, car service is ready and all accesses are ok Otherwise car service has crashed or killed and will be restarted \u003cbr /\u003e |"]]