Android APIs
public class

CustomTabsClient

extends Object
java.lang.Object
   ↳ android.support.customtabs.CustomTabsClient

Class Overview

Class to communicate with a CustomTabsService and create CustomTabsSession from it.

Summary

Public Methods
static boolean bindCustomTabsService(Context context, String packageName, CustomTabsServiceConnection connection)
Bind to a CustomTabsService using the given package name and ServiceConnection.
Bundle extraCommand(String commandName, Bundle args)
CustomTabsSession newSession(CustomTabsCallback callback)
Creates a new session through an ICustomTabsService with the optional callback.
boolean warmup(long flags)
Warm up the browser process.
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public static boolean bindCustomTabsService (Context context, String packageName, CustomTabsServiceConnection connection)

Bind to a CustomTabsService using the given package name and ServiceConnection.

Parameters
context Context to use while calling bindService(Intent, ServiceConnection, int)
packageName Package name to set on the Intent for binding.
connection CustomTabsServiceConnection to use when binding. This will return a CustomTabsClient on #onCustomTabsServiceConnected(ComponentName, CustomTabsClient)
Returns
  • Whether the binding was successful.

public Bundle extraCommand (String commandName, Bundle args)

public CustomTabsSession newSession (CustomTabsCallback callback)

Creates a new session through an ICustomTabsService with the optional callback. This session can be used to associate any related communication through the service with an intent and then later with a Custom Tab. The client can then send later service calls or intents to through same session-intent-Custom Tab association.

Parameters
callback The callback through which the client will receive updates about the created session. Can be null.
Returns
  • The session object that was created as a result of the transaction. The client can use this to relay mayLaunchUrl(Uri, Bundle, List) calls. Null on error.

public boolean warmup (long flags)

Warm up the browser process.

Parameters
flags Reserved for future use.
Returns
  • Whether the warmup was successful.