Stay organized with collections
Save and categorize content based on your preferences.
SecondarySessionStateCallback
@RequiresApi(value = 26) interface SecondarySessionStateCallback extends 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 methods |
abstract void |
Called when a SecondarySession can no longer be connected to a Primary.
|
Public methods
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\n[Kotlin](/reference/kotlin/com/google/ambient/crossdevice/sessions/SecondarySessionStateCallback \"View this page in Kotlin\") \\|Java\n\n\n```\n@RequiresApi(value = 26) interface SecondarySessionStateCallback extends 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/com/google/ambient/crossdevice/sessions/Sessions#getSecondarySession(android.content.Intent,com.google.ambient.crossdevice.sessions.SecondarySessionStateCallback)).\n\nSummary\n-------\n\n| ### Public methods ||\n|-----------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `abstract void` | [onSecondarySessionCleanup](/reference/com/google/ambient/crossdevice/sessions/SecondarySessionStateCallback#onSecondarySessionCleanup(com.google.ambient.crossdevice.sessions.SessionId))`(@`[NonNull](/reference/androidx/annotation/NonNull)` `[SessionId](/reference/com/google/ambient/crossdevice/sessions/SessionId)` sessionId)` Called when a [SecondarySession](/reference/com/google/ambient/crossdevice/sessions/SecondarySession) can no longer be connected to a Primary. |\n\nPublic methods\n--------------\n\n### onSecondarySessionCleanup\n\n```\nabstract void onSecondarySessionCleanup(@NonNull SessionId sessionId)\n```\n\nCalled when a [SecondarySession](/reference/com/google/ambient/crossdevice/sessions/SecondarySession) can no longer be connected to a Primary. Continued use of the [SecondarySession](/reference/com/google/ambient/crossdevice/sessions/SecondarySession) will return [SessionException](/reference/com/google/ambient/crossdevice/sessions/SessionException) on all method calls because it is no longer valid."]]