belongs to Maven artifact com.android.support:customtabs:28.0.0-alpha1
CustomTabsCallback
  public
  
  
  
  class
  CustomTabsCallback
  
    extends Object
  
  
  
  
  
  
| java.lang.Object | |
| ↳ | android.support.customtabs.CustomTabsCallback | 
A callback class for custom tabs client to get messages regarding events in their custom tabs. In the implementation, all callbacks are sent to the UI thread for the client.
Summary
| Constants | |
|---|---|
| int | NAVIGATION_ABORTEDSent when loading was aborted by a user action before it finishes like clicking on a link or refreshing the page. | 
| int | NAVIGATION_FAILEDSent when the tab couldn't finish loading due to a failure. | 
| int | NAVIGATION_FINISHEDSent when the tab has finished loading a page. | 
| int | NAVIGATION_STARTEDSent when the tab has started loading a page. | 
| int | TAB_HIDDENSent when the tab becomes hidden. | 
| int | TAB_SHOWNSent when the tab becomes visible. | 
| Public constructors | |
|---|---|
| 
      CustomTabsCallback()
       | |
| Public methods | |
|---|---|
| 
        
        
        
        
        
        void | 
      extraCallback(String callbackName, Bundle args)
      Unsupported callbacks that may be provided by the implementation. | 
| 
        
        
        
        
        
        void | 
      onMessageChannelReady(Bundle extras)
      Called when  | 
| 
        
        
        
        
        
        void | 
      onNavigationEvent(int navigationEvent, Bundle extras)
      To be called when a navigation event happens. | 
| 
        
        
        
        
        
        void | 
      onPostMessage(String message, Bundle extras)
      Called when a tab controlled by this  | 
| 
        
        
        
        
        
        void | 
      onRelationshipValidationResult(int relation, Uri requestedOrigin, boolean result, Bundle extras)
      Called when a relationship validation result is available. | 
| Inherited methods | |
|---|---|
|  From
class 
  
    java.lang.Object
  
 | |
Constants
NAVIGATION_ABORTED
int NAVIGATION_ABORTED
Sent when loading was aborted by a user action before it finishes like clicking on a link or refreshing the page.
Constant Value: 4 (0x00000004)
NAVIGATION_FAILED
int NAVIGATION_FAILED
Sent when the tab couldn't finish loading due to a failure.
Constant Value: 3 (0x00000003)
NAVIGATION_FINISHED
int NAVIGATION_FINISHED
Sent when the tab has finished loading a page.
Constant Value: 2 (0x00000002)
NAVIGATION_STARTED
int NAVIGATION_STARTED
Sent when the tab has started loading a page.
Constant Value: 1 (0x00000001)
TAB_HIDDEN
int TAB_HIDDEN
Sent when the tab becomes hidden.
Constant Value: 6 (0x00000006)
TAB_SHOWN
int TAB_SHOWN
Sent when the tab becomes visible.
Constant Value: 5 (0x00000005)
Public constructors
Public methods
extraCallback
void extraCallback (String callbackName, 
                Bundle args)Unsupported callbacks that may be provided by the implementation.
Note:Clients should never rely on this callback to be called and/or to have a defined behavior, as it is entirely implementation-defined and not supported.
This can be used by implementations to add extra callbacks, for testing or experimental purposes.
| Parameters | |
|---|---|
| callbackName | String: Name of the extra callback. | 
| args | Bundle: Arguments for the calback | 
onMessageChannelReady
void onMessageChannelReady (Bundle extras)
Called when CustomTabsSession has requested a postMessage channel through
 requestPostMessageChannel(CustomTabsSessionToken, android.net.Uri) and the channel
 is ready for sending and receiving messages on both ends.
| Parameters | |
|---|---|
| extras | Bundle: Reserved for future use. | 
onNavigationEvent
void onNavigationEvent (int navigationEvent, 
                Bundle extras)To be called when a navigation event happens.
| Parameters | |
|---|---|
| navigationEvent | int: The code corresponding to the navigation event. | 
| extras | Bundle: Reserved for future use. | 
onPostMessage
void onPostMessage (String message, 
                Bundle extras)Called when a tab controlled by this CustomTabsSession has sent a postMessage.
 If postMessage() is called from a single thread, then the messages will be posted in the
 same order. When received on the client side, it is the client's responsibility to preserve
 the ordering further.
| Parameters | |
|---|---|
| message | String: The message sent. | 
| extras | Bundle: Reserved for future use. | 
onRelationshipValidationResult
void onRelationshipValidationResult (int relation, 
                Uri requestedOrigin, 
                boolean result, 
                Bundle extras)Called when a relationship validation result is available.
| Parameters | |
|---|---|
| relation | int: Relation for which the result is available. Value previously passed tovalidateRelationship(int, Uri, Bundle). Must be one
                 of theCustomTabsService#RELATION_* constants. | 
| requestedOrigin | Uri: Origin requested. Value previously passed tovalidateRelationship(int, Uri, Bundle). | 
| result | boolean: Whether the relation was validated. | 
| extras | Bundle: Reserved for future use. | 
- Annotations
- Classes- CustomTabsCallback
- CustomTabsClient
- CustomTabsIntent
- CustomTabsIntent.Builder
- CustomTabsService
- CustomTabsServiceConnection
- CustomTabsSession
- CustomTabsSessionToken
- PostMessageService
- PostMessageServiceConnection
- R
- R.anim
- R.attr
- R.bool
- R.color
- R.dimen
- R.drawable
- R.id
- R.integer
- R.layout
- R.string
- R.style
- R.styleable
- TrustedWebUtils
 
