Stay organized with collections
Save and categorize content based on your preferences.
SecondarySessionStateCallback
@RequiresApi(value = 26) interface SecondarySessionStateCallback : SessionStateCallback
Clients of Sessions should implement SecondarySessionStateCallback
to receive notifications of Session state changes when acting as the Secondary for a shared Session.
Provide your implementation in Sessions.getSecondarySession
.
Summary
Public functions
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-10 UTC.
[null,null,["Last updated 2025-02-10 UTC."],[],[],null,["# SecondarySessionStateCallback\n=============================\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/com/google/ambient/crossdevice/sessions/SecondarySessionStateCallback \"View this page in Java\")\n\n\n```\n@RequiresApi(value = 26) interface SecondarySessionStateCallback : SessionStateCallback\n```\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nClients of Sessions should implement `SecondarySessionStateCallback` to receive notifications of Session state changes when acting as the Secondary for a shared Session.\n\nProvide your implementation in [Sessions.getSecondarySession](/reference/kotlin/com/google/ambient/crossdevice/sessions/Sessions#getSecondarySession(android.content.Intent,com.google.ambient.crossdevice.sessions.SecondarySessionStateCallback)).\n\nSummary\n-------\n\n| ### Public functions ||\n|---------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [Unit](/reference/kotlin/kotlin/Unit) | [onSecondarySessionCleanup](/reference/kotlin/com/google/ambient/crossdevice/sessions/SecondarySessionStateCallback#onSecondarySessionCleanup(com.google.ambient.crossdevice.sessions.SessionId))`(sessionId: `[SessionId](/reference/kotlin/com/google/ambient/crossdevice/sessions/SessionId)`)` Called when a [SecondarySession](/reference/kotlin/com/google/ambient/crossdevice/sessions/SecondarySession) can no longer be connected to a Primary. |\n\nPublic functions\n----------------\n\n### onSecondarySessionCleanup\n\n```\nfun onSecondarySessionCleanup(sessionId: SessionId): Unit\n```\n\nCalled when a [SecondarySession](/reference/kotlin/com/google/ambient/crossdevice/sessions/SecondarySession) can no longer be connected to a Primary. Continued use of the [SecondarySession](/reference/kotlin/com/google/ambient/crossdevice/sessions/SecondarySession) will return [SessionException](/reference/kotlin/com/google/ambient/crossdevice/sessions/SessionException) on all method calls because it is no longer valid."]]