belongs to Maven artifact com.android.support:customtabs:28.0.0-alpha1
CustomTabsClient
public
class
CustomTabsClient
extends Object
java.lang.Object | |
↳ | android.support.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 |
static
boolean
|
connectAndInitialize(Context context, String packageName)
Connects to the Custom Tabs warmup service, and initializes the browser. |
Bundle
|
extraCommand(String commandName, Bundle args)
|
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. |
boolean
|
warmup(long flags)
Warm up the browser process. |
Inherited methods | |
---|---|
![]()
java.lang.Object
|
Public methods
bindCustomTabsService
boolean bindCustomTabsService (Context context, String packageName, CustomTabsServiceConnection connection)
Bind to a CustomTabsService
using the given package name and
ServiceConnection
.
Parameters | |
---|---|
context |
Context : Context to use while calling
bindService(Intent, ServiceConnection, int) |
packageName |
String : Package name to set on the Intent for binding. |
connection |
CustomTabsServiceConnection : CustomTabsServiceConnection to use when binding. This will
return a CustomTabsClient on
#onCustomTabsServiceConnected(ComponentName, CustomTabsClient) |
Returns | |
---|---|
boolean |
Whether the binding was successful. |
connectAndInitialize
boolean connectAndInitialize (Context context, String packageName)
Connects to the Custom Tabs warmup service, and initializes the browser