belongs to Maven artifact com.android.support:customtabs:28.0.0-alpha1
CustomTabsSession
public
final
class
CustomTabsSession
extends Object
java.lang.Object | |
↳ | android.support.customtabs.CustomTabsSession |
A class to be used for Custom Tabs related communication. Clients that want to launch Custom Tabs can use this class exclusively to handle all related communication.
Summary
Public methods | |
---|---|
static
CustomTabsSession
|
createMockSessionForTesting(ComponentName componentName)
Provides browsers a way to generate a mock |
boolean
|
mayLaunchUrl(Uri url, Bundle extras, List<Bundle> otherLikelyBundles)
Tells the browser of a likely future navigation to a URL. |
int
|
postMessage(String message, Bundle extras)
Sends a postMessage request using the origin communicated via
|
boolean
|
requestPostMessageChannel(Uri postMessageOrigin)
Sends a request to create a two way postMessage channel between the client and the browser. |
boolean
|
setActionButton(Bitmap icon, String description)
This sets the action button on the toolbar with ID
|
boolean
|
setSecondaryToolbarViews(RemoteViews remoteViews, int[] clickableIDs, PendingIntent pendingIntent)
Updates the |
boolean
|
setToolbarItem(int id, Bitmap icon, String description)
This method was deprecated in API level 25.1.0. Use CustomTabsSession#setSecondaryToolbarViews(RemoteViews, int[], PendingIntent) |
boolean
|
validateRelationship(int relation, Uri origin, Bundle extras)
Requests to validate a relationship between the application and an origin. |
Inherited methods | |
---|---|
![]()
java.lang.Object
|
Public methods
createMockSessionForTesting
CustomTabsSession createMockSessionForTesting (ComponentName componentName)
Provides browsers a way to generate a mock CustomTabsSession
for testing
purposes.
Parameters | |
---|---|
componentName |
ComponentName : The component the session should be created for. |
Returns | |
---|---|
CustomTabsSession |
A mock session with no functionality. |
mayLaunchUrl
boolean mayLaunchUrl (Uri url, Bundle extras, List<Bundle> otherLikelyBundles)
Tells the browser of a likely future navigation to a URL. The most likely URL has to be specified first. Optionally, a list of other likely URLs can be provided. They are treated as less likely than the first one, and have to be sorted in decreasing priority order. These additional URLs may be ignored. All previous calls to this method will be deprioritized.
Parameters | |
---|---|
url |
Uri : Most likely URL. |
extras |