added in version 1.0.0
belongs to Maven artifact androidx.browser:browser:1.0.0-beta01

CustomTabsSessionToken

public class CustomTabsSessionToken
extends Object

java.lang.Object
   ↳ 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

static CustomTabsSessionToken createMockSessionTokenForTesting()

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

boolean equals(Object o)
CustomTabsCallback getCallback()
static CustomTabsSessionToken getSessionTokenFromIntent(Intent intent)

Obtain a CustomTabsSessionToken from an intent.

int hashCode()
boolean isAssociatedWith(CustomTabsSession session)

Inherited methods

Public methods

createMockSessionTokenForTesting

added in version 1.0.0
public static CustomTabsSessionToken createMockSessionTokenForTesting ()

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

Returns
CustomTabsSessionToken A mock token with no functionality.

equals

public boolean equals (Object o)

Parameters
o Object

Returns
boolean

getCallback

added in version 1.0.0
public CustomTabsCallback getCallback ()

Returns
CustomTabsCallback CustomTabsCallback corresponding to this session if there was any non-null callbacks passed by the client.

getSessionTokenFromIntent

added in version 1.0.0
public static CustomTabsSessionToken getSessionTokenFromIntent (Intent intent)

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.

Returns
CustomTabsSessionToken The token that was generated.

hashCode

public int hashCode ()

Returns
int

isAssociatedWith

added in version 1.0.0
public boolean isAssociatedWith (CustomTabsSession session)

Parameters
session CustomTabsSession

Returns
boolean Whether this token is associated with the given session.