Android Dev Summit, October 23-24: two days of technical content, directly from the Android team. Sign-up for livestream updates.

CustomTabsSessionToken

open class CustomTabsSessionToken
kotlin.Any
   ↳ androidx.browser.customtabs.CustomTabsSessionToken

Wrapper class that can be used as a unique identifier for a session. Also contains an accessor for the CustomTabsCallback for the session if there was any.

Summary

Public methods

open static CustomTabsSessionToken

Provides browsers a way to generate a mock CustomTabsSessionToken for testing purposes.

open Boolean
equals(other: Any?)

open CustomTabsCallback?

open static CustomTabsSessionToken?

Obtain a CustomTabsSessionToken from an intent.

open Int

open Boolean

Public methods

createMockSessionTokenForTesting

@NonNull open static fun createMockSessionTokenForTesting(): CustomTabsSessionToken

Provides browsers a way to generate a mock CustomTabsSessionToken for testing purposes.

Return
CustomTabsSessionToken: A mock token with no functionality.

equals

open fun equals(other: Any?): Boolean

getCallback

@Nullable open fun getCallback(): CustomTabsCallback?
Return
CustomTabsCallback?: CustomTabsCallback corresponding to this session if there was any non-null callbacks passed by the client.

getSessionTokenFromIntent

@Nullable open static fun getSessionTokenFromIntent(@NonNull intent: Intent): CustomTabsSessionToken?

Obtain a CustomTabsSessionToken from an intent. See CustomTabsIntent.Builder for ways to generate an intent for custom tabs.

Parameters
intent Intent: The intent to generate the token from. This has to include an extra for CustomTabsIntent#EXTRA_SESSION.
Return
CustomTabsSessionToken?: The token that was generated.

hashCode

open fun hashCode(): Int

isAssociatedWith

open fun isAssociatedWith(@NonNull session: CustomTabsSession): Boolean
Return
Boolean: Whether this token is associated with the given session.