The base class for implementing a session for a car app.
Requests the first
Notifies that the car app has received a new
public Session ()
public final CarContext getCarContext ()
CarContext for this session.
CarContext is not expected to be available until this session's
Lifecycle.State is at least
Lifecycle.State.CREATED. Further, some instance
CarContext should not be called before this state has been reached.
See the documentation in
CarContext for details on any such restrictions.
public Lifecycle getLifecycle ()
Here are some of the ways you can use the sessions's
- Observe its
Lifecycle.addObserver(LifecycleObserver). You can use the
LifecycleObserverto take specific actions whenever the
- Use this
LiveDatas that may drive the backing data for your application.
What each lifecycle related event means for a session:
- The session has just been launched, and this session is being initialized.
onCreateScreen(Intent)will be called at a point after this call.
- The host is ready for this session to create the first
Screenso that it can display its template.
- The application is now visible in the car screen.
- The user can now interact with this application.
- The user can no longer interact with this application.
- The application is no longer visible.
- The OS has now destroyed this
Sessioninstance, and it is no longer valid.
Note lifecycle callbacks will be executed on the main thread.
||The lifecycle of the provider.|