public final class CustomTabsSession extends Object
Modifier and Type | Method and Description |
---|---|
boolean |
mayLaunchUrl(Uri url,
Bundle extras,
List<Bundle> otherLikelyBundles)
Tells the browser of a likely future navigation to a URL.
|
boolean |
setActionButton(Bitmap icon,
String description)
This sets the action button on the toolbar with ID
CustomTabsIntent.TOOLBAR_ACTION_BUTTON_ID . |
boolean |
setSecondaryToolbarViews(RemoteViews remoteViews,
int[] clickableIDs,
PendingIntent pendingIntent)
Updates the
RemoteViews of the secondary toolbar in an existing custom tab session. |
boolean |
setToolbarItem(int id,
Bitmap icon,
String description)
Deprecated.
Use
CustomTabsSession#setSecondaryToolbarViews(RemoteViews, int[], PendingIntent)
|
public boolean mayLaunchUrl(Uri url, Bundle extras, List<Bundle> otherLikelyBundles)
url
- Most likely URL.extras
- Reserved for future use.otherLikelyBundles
- Other likely destinations, sorted in decreasing
likelihood order. Inside each Bundle, the client should provide a
Uri
using CustomTabsService.KEY_URL
with
Bundle.putParcelable(String, android.os.Parcelable)
.public boolean setActionButton(@NonNull Bitmap icon, @NonNull String description)
CustomTabsIntent.TOOLBAR_ACTION_BUTTON_ID
.icon
- The new icon of the action button.description
- Content description of the action button.CustomTabsSession#setToolbarItem(int, Bitmap, String)}
public boolean setSecondaryToolbarViews(@Nullable RemoteViews remoteViews, @Nullable int[] clickableIDs, @Nullable PendingIntent pendingIntent)
RemoteViews
of the secondary toolbar in an existing custom tab session.remoteViews
- The updated RemoteViews
that will be shown in secondary toolbar.
If null, the current secondary toolbar will be dismissed.clickableIDs
- The ids of clickable views. The onClick event of these views will be
handled by custom tabs.pendingIntent
- The PendingIntent
that will be sent when the user clicks on one
of the View
s in clickableIDs.@Deprecated public boolean setToolbarItem(int id, @NonNull Bitmap icon, @NonNull String description)
id
- The id for the item to update.icon
- The new icon of the toolbar item.description
- Content description of the toolbar item.