addToolbarItem

This method was deprecated
in API level 24.1.0.
Use
CustomTabsIntent.Builder#setSecondaryToolbarViews(RemoteViews, int[], PendingIntent).

Adds an action button to the custom tab. Multiple buttons can be added via this method.
If the given id equals TOOLBAR_ACTION_BUTTON_ID, the button will be placed on
the toolbar; if the bitmap is too wide, it will be put to the bottom bar instead. If
the id is not TOOLBAR_ACTION_BUTTON_ID, it will be directly put on secondary
toolbar. The maximum number of allowed toolbar items in a single intent is
getMaxToolbarItems(). Throws an
IllegalStateException when that number is exceeded per intent.

Parameters

id

int: The unique id of the action button. This should be non-negative.

icon

Bitmap: The icon.

description

String: The description for the button. To be used for accessibility.

pendingIntent

PendingIntent: The pending intent delivered when the button is clicked.