CustomTabsClient

public class CustomTabsClient
extends Object

java.lang.Object
   ↳ androidx.browser.customtabs.CustomTabsClient


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.

static boolean bindCustomTabsServicePreservePriority(Context context, String packageName, CustomTabsServiceConnection connection)

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

static boolean connectAndInitialize(Context context, String packageName)

Connects to the Custom Tabs warmup service, and initializes the browser.

Bundle extraCommand(String commandName, Bundle args)

Can be used as a channel between the Custom Tabs client and the provider to do something that is not part of the API yet.

static String getPackageName(Context context, List<String> packages)

Returns the preferred package to use for Custom Tabs, preferring the default VIEW handler.

static String getPackageName(Context context, List<String> packages, boolean ignoreDefault)

Returns the preferred package to use for Custom Tabs.

CustomTabsSession newSession(CustomTabsCallback callback)

Creates a new session through an ICustomTabsService with the optional callback.

CustomTabsSession newSession(CustomTabsCallback callback, int id)

Creates a new session or updates a callback for the existing session through an ICustomTabsService.

boolean warmup<