# Snackbar.Callback

added in[version 23.4.0](https://developer.android.com/topic/libraries/support-library/revisions)  
belongs to Maven artifact com.android.support:design:27.1.0  
Summary:[Constants](https://developer.android.com/reference/android/support/design/widget/Snackbar.Callback#constants)\|[Inherited Constants](https://developer.android.com/reference/android/support/design/widget/Snackbar.Callback#inhconstants)\|[Ctors](https://developer.android.com/reference/android/support/design/widget/Snackbar.Callback#pubctors)\|[Methods](https://developer.android.com/reference/android/support/design/widget/Snackbar.Callback#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/support/design/widget/Snackbar.Callback#inhmethods)\|[\[Expand All\]](https://developer.android.com/reference/android/support/design/widget/Snackbar.Callback#)  

# Snackbar.Callback

| This package is part of the Android[support library](https://developer.android.com/topic/libraries/support-library)which is no longer maintained. The support library has been superseded by[AndroidX](https://developer.android.com/jetpack/androidx)which is part of[Jetpack](https://developer.android.com/jetpack). We recommend using the AndroidX libraries in all new projects. You should also consider[migrating](https://developer.android.com/jetpack/androidx/migrate)existing projects to AndroidX. To find the AndroidX class that maps to this deprecated class, see the AndroidX support library[class mappings](https://developer.android.com/jetpack/androidx/migrate/class-mappings).

`
public
static


class
Snackbar.Callback
`  
`


``

extends `[BaseCallback](https://developer.android.com/reference/android/support/design/widget/BaseTransientBottomBar.BaseCallback)`<`[Snackbar](https://developer.android.com/reference/android/support/design/widget/Snackbar)`>


``


`

|---|---|-------------------------------------------------|
| java.lang.Object                                      |||
| ↳ | [android.support.design.widget.BaseTransientBottomBar.BaseCallback](https://developer.android.com/reference/android/support/design/widget/BaseTransientBottomBar.BaseCallback)\<[android.support.design.widget.Snackbar](https://developer.android.com/reference/android/support/design/widget/Snackbar)\> ||
|   | ↳ | android.support.design.widget.Snackbar.Callback |

<br />

*** ** * ** ***

Callback class for[Snackbar](https://developer.android.com/reference/android/support/design/widget/Snackbar)instances. Note: this class is here to provide backwards-compatible way for apps written before the existence of the base[BaseTransientBottomBar](https://developer.android.com/reference/android/support/design/widget/BaseTransientBottomBar)class.  
**See also:**

- [addCallback(BaseCallback)](https://developer.android.com/reference/android/support/design/widget/BaseTransientBottomBar#addCallback(android.support.design.widget.BaseTransientBottomBar.BaseCallback<B>))

## Summary

|                                                                                                                                                      ### Constants                                                                                                                                                      ||
|-------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `int` | [DISMISS_EVENT_ACTION](https://developer.android.com/reference/android/support/design/widget/Snackbar.Callback#DISMISS_EVENT_ACTION) Indicates that the Snackbar was dismissed via an action click.                                                                                                              |
| `int` | [DISMISS_EVENT_CONSECUTIVE](https://developer.android.com/reference/android/support/design/widget/Snackbar.Callback#DISMISS_EVENT_CONSECUTIVE) Indicates that the Snackbar was dismissed from a new Snackbar being shown.                                                                                        |
| `int` | [DISMISS_EVENT_MANUAL](https://developer.android.com/reference/android/support/design/widget/Snackbar.Callback#DISMISS_EVENT_MANUAL) Indicates that the Snackbar was dismissed via a call to[dismiss()](https://developer.android.com/reference/android/support/design/widget/BaseTransientBottomBar#dismiss()). |
| `int` | [DISMISS_EVENT_SWIPE](https://developer.android.com/reference/android/support/design/widget/Snackbar.Callback#DISMISS_EVENT_SWIPE) Indicates that the Snackbar was dismissed via a swipe.                                                                                                                        |
| `int` | [DISMISS_EVENT_TIMEOUT](https://developer.android.com/reference/android/support/design/widget/Snackbar.Callback#DISMISS_EVENT_TIMEOUT) Indicates that the Snackbar was dismissed via a timeout.                                                                                                                  |

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ### Inherited constants                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/design/widget/Snackbar.Callback#)From class` `[android.support.design.widget.BaseTransientBottomBar.BaseCallback](https://developer.android.com/reference/android/support/design/widget/BaseTransientBottomBar.BaseCallback)` ` |-------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | `int` | [DISMISS_EVENT_ACTION](https://developer.android.com/reference/android/support/design/widget/BaseTransientBottomBar.BaseCallback#DISMISS_EVENT_ACTION) Indicates that the Snackbar was dismissed via an action click.                                                                                                              | | `int` | [DISMISS_EVENT_CONSECUTIVE](https://developer.android.com/reference/android/support/design/widget/BaseTransientBottomBar.BaseCallback#DISMISS_EVENT_CONSECUTIVE) Indicates that the Snackbar was dismissed from a new Snackbar being shown.                                                                                        | | `int` | [DISMISS_EVENT_MANUAL](https://developer.android.com/reference/android/support/design/widget/BaseTransientBottomBar.BaseCallback#DISMISS_EVENT_MANUAL) Indicates that the Snackbar was dismissed via a call to[dismiss()](https://developer.android.com/reference/android/support/design/widget/BaseTransientBottomBar#dismiss()). | | `int` | [DISMISS_EVENT_SWIPE](https://developer.android.com/reference/android/support/design/widget/BaseTransientBottomBar.BaseCallback#DISMISS_EVENT_SWIPE) Indicates that the Snackbar was dismissed via a swipe.                                                                                                                        | | `int` | [DISMISS_EVENT_TIMEOUT](https://developer.android.com/reference/android/support/design/widget/BaseTransientBottomBar.BaseCallback#DISMISS_EVENT_TIMEOUT) Indicates that the Snackbar was dismissed via a timeout.                                                                                                                  | |

|                                                           ### Public constructors                                                           ||
|------------------------------------------------------------------------------------------------------------------------------------------|---|
| ` `[Snackbar.Callback](https://developer.android.com/reference/android/support/design/widget/Snackbar.Callback#Snackbar.Callback())`() ` |

|                                                                                                                                                                                                                                                                        ### Public methods                                                                                                                                                                                                                                                                        ||
|---------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` void` | ` `[onDismissed](https://developer.android.com/reference/android/support/design/widget/Snackbar.Callback#onDismissed(android.support.design.widget.Snackbar, int))`(`[Snackbar](https://developer.android.com/reference/android/support/design/widget/Snackbar)` transientBottomBar, int event) ` Called when the given[BaseTransientBottomBar](https://developer.android.com/reference/android/support/design/widget/BaseTransientBottomBar)has been dismissed, either through a time-out, having been manually dismissed, or an action being clicked. |
| ` void` | ` `[onShown](https://developer.android.com/reference/android/support/design/widget/Snackbar.Callback#onShown(android.support.design.widget.Snackbar))`(`[Snackbar](https://developer.android.com/reference/android/support/design/widget/Snackbar)` sb) ` Called when the given[BaseTransientBottomBar](https://developer.android.com/reference/android/support/design/widget/BaseTransientBottomBar)is visible.                                                                                                                                        |

| ### Inherited methods |
|-----------------------|---|
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/design/widget/Snackbar.Callback#)From class` `[android.support.design.widget.BaseTransientBottomBar.BaseCallback](https://developer.android.com/reference/android/support/design/widget/BaseTransientBottomBar.BaseCallback)` ` |---------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` void` | ` `[onDismissed](https://developer.android.com/reference/android/support/design/widget/BaseTransientBottomBar.BaseCallback#onDismissed(B, int))`(`[Snackbar](https://developer.android.com/reference/android/support/design/widget/Snackbar)` transientBottomBar, int event) ` Called when the given[BaseTransientBottomBar](https://developer.android.com/reference/android/support/design/widget/BaseTransientBottomBar)has been dismissed, either through a time-out, having been manually dismissed, or an action being clicked. | | ` void` | ` `[onShown](https://developer.android.com/reference/android/support/design/widget/BaseTransientBottomBar.BaseCallback#onShown(B))`(`[Snackbar](https://developer.android.com/reference/android/support/design/widget/Snackbar)` transientBottomBar) ` Called when the given[BaseTransientBottomBar](https://developer.android.com/reference/android/support/design/widget/BaseTransientBottomBar)is visible.                                                                                                                        | ||
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/design/widget/Snackbar.Callback#)From class` java.lang.Object ` |-------------------|-------------------------------| | ` Object`         | ` clone() `                   | | ` boolean`        | ` equals(Object arg0) `       | | ` void`           | ` finalize() `                | | ` final Class<?>` | ` getClass() `                | | ` int`            | ` hashCode() `                | | ` final void`     | ` notify() `                  | | ` final void`     | ` notifyAll() `               | | ` String`         | ` toString() `                | | ` final void`     | ` wait(long arg0, int arg1) ` | | ` final void`     | ` wait(long arg0) `           | | ` final void`     | ` wait() `                    | ||

## Constants

### DISMISS_EVENT_ACTION

added in[version 23.4.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
int DISMISS_EVENT_ACTION
```

Indicates that the Snackbar was dismissed via an action click.

<br />

Constant Value: 1 (0x00000001)  

### DISMISS_EVENT_CONSECUTIVE

added in[version 23.4.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
int DISMISS_EVENT_CONSECUTIVE
```

Indicates that the Snackbar was dismissed from a new Snackbar being shown.

<br />

Constant Value: 4 (0x00000004)  

### DISMISS_EVENT_MANUAL

added in[version 23.4.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
int DISMISS_EVENT_MANUAL
```

Indicates that the Snackbar was dismissed via a call to[dismiss()](https://developer.android.com/reference/android/support/design/widget/BaseTransientBottomBar#dismiss()).

<br />

Constant Value: 3 (0x00000003)  

### DISMISS_EVENT_SWIPE

added in[version 23.4.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
int DISMISS_EVENT_SWIPE
```

Indicates that the Snackbar was dismissed via a swipe.

<br />

Constant Value: 0 (0x00000000)  

### DISMISS_EVENT_TIMEOUT

added in[version 23.4.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
int DISMISS_EVENT_TIMEOUT
```

Indicates that the Snackbar was dismissed via a timeout.

<br />

Constant Value: 2 (0x00000002)

## Public constructors

### Snackbar.Callback

added in[version 23.4.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
Snackbar.Callback ()
```

<br />

<br />

## Public methods

### onDismissed

added in[version 23.4.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void onDismissed (Snackbar transientBottomBar, 
                int event)
```

Called when the given[BaseTransientBottomBar](https://developer.android.com/reference/android/support/design/widget/BaseTransientBottomBar)has been dismissed, either through a time-out, having been manually dismissed, or an action being clicked.

<br />

|                                                                                                                                                                                                                                                                                                                                                                                          Parameters                                                                                                                                                                                                                                                                                                                                                                                          ||
|----------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `transientBottomBar` | `Snackbar`: The transient bottom bar which has been dismissed. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| `event`              | `int`: The event which caused the dismissal. One of either:[DISMISS_EVENT_SWIPE](https://developer.android.com/reference/android/support/design/widget/Snackbar.Callback#DISMISS_EVENT_SWIPE),[DISMISS_EVENT_ACTION](https://developer.android.com/reference/android/support/design/widget/Snackbar.Callback#DISMISS_EVENT_ACTION),[DISMISS_EVENT_TIMEOUT](https://developer.android.com/reference/android/support/design/widget/Snackbar.Callback#DISMISS_EVENT_TIMEOUT),[DISMISS_EVENT_MANUAL](https://developer.android.com/reference/android/support/design/widget/Snackbar.Callback#DISMISS_EVENT_MANUAL)or[DISMISS_EVENT_CONSECUTIVE](https://developer.android.com/reference/android/support/design/widget/Snackbar.Callback#DISMISS_EVENT_CONSECUTIVE). <br /> |

### onShown

added in[version 23.4.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void onShown (Snackbar sb)
```

Called when the given[BaseTransientBottomBar](https://developer.android.com/reference/android/support/design/widget/BaseTransientBottomBar)is visible.

<br />

|                               Parameters                                ||
|------|-------------------------------------------------------------------|
| `sb` | `Snackbar`: The transient bottom bar which is now visible. <br /> |

-

  ## Annotations

  - [CoordinatorLayout.DefaultBehavior](https://developer.android.com/reference/android/support/design/widget/CoordinatorLayout.DefaultBehavior)
-

  ## Interfaces

  - [AppBarLayout.OnOffsetChangedListener](https://developer.android.com/reference/android/support/design/widget/AppBarLayout.OnOffsetChangedListener)
  - [BaseTransientBottomBar.ContentViewCallback](https://developer.android.com/reference/android/support/design/widget/BaseTransientBottomBar.ContentViewCallback)
  - [BottomNavigationView.OnNavigationItemReselectedListener](https://developer.android.com/reference/android/support/design/widget/BottomNavigationView.OnNavigationItemReselectedListener)
  - [BottomNavigationView.OnNavigationItemSelectedListener](https://developer.android.com/reference/android/support/design/widget/BottomNavigationView.OnNavigationItemSelectedListener)
  - [CoordinatorLayout.AttachedBehavior](https://developer.android.com/reference/android/support/design/widget/CoordinatorLayout.AttachedBehavior)
  - [NavigationView.OnNavigationItemSelectedListener](https://developer.android.com/reference/android/support/design/widget/NavigationView.OnNavigationItemSelectedListener)
  - [SwipeDismissBehavior.OnDismissListener](https://developer.android.com/reference/android/support/design/widget/SwipeDismissBehavior.OnDismissListener)
  - [TabLayout.OnTabSelectedListener](https://developer.android.com/reference/android/support/design/widget/TabLayout.OnTabSelectedListener)
-

  ## Classes

  - [AppBarLayout](https://developer.android.com/reference/android/support/design/widget/AppBarLayout)
  - [AppBarLayout.Behavior](https://developer.android.com/reference/android/support/design/widget/AppBarLayout.Behavior)
  - [AppBarLayout.Behavior.DragCallback](https://developer.android.com/reference/android/support/design/widget/AppBarLayout.Behavior.DragCallback)
  - [AppBarLayout.Behavior.SavedState](https://developer.android.com/reference/android/support/design/widget/AppBarLayout.Behavior.SavedState)
  - [AppBarLayout.LayoutParams](https://developer.android.com/reference/android/support/design/widget/AppBarLayout.LayoutParams)
  - [AppBarLayout.ScrollingViewBehavior](https://developer.android.com/reference/android/support/design/widget/AppBarLayout.ScrollingViewBehavior)
  - [BaseTransientBottomBar](https://developer.android.com/reference/android/support/design/widget/BaseTransientBottomBar)
  - [BaseTransientBottomBar.BaseCallback](https://developer.android.com/reference/android/support/design/widget/BaseTransientBottomBar.BaseCallback)
  - [BottomNavigationView](https://developer.android.com/reference/android/support/design/widget/BottomNavigationView)
  - [BottomSheetBehavior](https://developer.android.com/reference/android/support/design/widget/BottomSheetBehavior)
  - [BottomSheetBehavior.BottomSheetCallback](https://developer.android.com/reference/android/support/design/widget/BottomSheetBehavior.BottomSheetCallback)
  - [BottomSheetBehavior.SavedState](https://developer.android.com/reference/android/support/design/widget/BottomSheetBehavior.SavedState)
  - [BottomSheetDialog](https://developer.android.com/reference/android/support/design/widget/BottomSheetDialog)
  - [BottomSheetDialogFragment](https://developer.android.com/reference/android/support/design/widget/BottomSheetDialogFragment)
  - [CollapsingToolbarLayout](https://developer.android.com/reference/android/support/design/widget/CollapsingToolbarLayout)
  - [CollapsingToolbarLayout.LayoutParams](https://developer.android.com/reference/android/support/design/widget/CollapsingToolbarLayout.LayoutParams)
  - [CoordinatorLayout](https://developer.android.com/reference/android/support/design/widget/CoordinatorLayout)
  - [CoordinatorLayout.Behavior](https://developer.android.com/reference/android/support/design/widget/CoordinatorLayout.Behavior)
  - [CoordinatorLayout.LayoutParams](https://developer.android.com/reference/android/support/design/widget/CoordinatorLayout.LayoutParams)
  - [CoordinatorLayout.SavedState](https://developer.android.com/reference/android/support/design/widget/CoordinatorLayout.SavedState)
  - [FloatingActionButton](https://developer.android.com/reference/android/support/design/widget/FloatingActionButton)
  - [FloatingActionButton.Behavior](https://developer.android.com/reference/android/support/design/widget/FloatingActionButton.Behavior)
  - [FloatingActionButton.OnVisibilityChangedListener](https://developer.android.com/reference/android/support/design/widget/FloatingActionButton.OnVisibilityChangedListener)
  - [NavigationView](https://developer.android.com/reference/android/support/design/widget/NavigationView)
  - [NavigationView.SavedState](https://developer.android.com/reference/android/support/design/widget/NavigationView.SavedState)
  - [Snackbar](https://developer.android.com/reference/android/support/design/widget/Snackbar)
  - [Snackbar.Callback](https://developer.android.com/reference/android/support/design/widget/Snackbar.Callback)
  - [SwipeDismissBehavior](https://developer.android.com/reference/android/support/design/widget/SwipeDismissBehavior)
  - [TabItem](https://developer.android.com/reference/android/support/design/widget/TabItem)
  - [TabLayout](https://developer.android.com/reference/android/support/design/widget/TabLayout)
  - [TabLayout.Tab](https://developer.android.com/reference/android/support/design/widget/TabLayout.Tab)
  - [TabLayout.TabLayoutOnPageChangeListener](https://developer.android.com/reference/android/support/design/widget/TabLayout.TabLayoutOnPageChangeListener)
  - [TabLayout.ViewPagerOnTabSelectedListener](https://developer.android.com/reference/android/support/design/widget/TabLayout.ViewPagerOnTabSelectedListener)
  - [TextInputEditText](https://developer.android.com/reference/android/support/design/widget/TextInputEditText)
  - [TextInputLayout](https://developer.android.com/reference/android/support/design/widget/TextInputLayout)