Android APIs
public static abstract class

Snackbar.Callback

extends Object
java.lang.Object
   ↳ android.support.design.widget.Snackbar.Callback

Class Overview

Callback class for Snackbar instances.

Summary

Constants
int DISMISS_EVENT_ACTION Indicates that the Snackbar was dismissed via an action click.
int DISMISS_EVENT_CONSECUTIVE Indicates that the Snackbar was dismissed from a new Snackbar being shown.
int DISMISS_EVENT_MANUAL Indicates that the Snackbar was dismissed via a call to dismiss().
int DISMISS_EVENT_SWIPE Indicates that the Snackbar was dismissed via a swipe.
int DISMISS_EVENT_TIMEOUT Indicates that the Snackbar was dismissed via a timeout.
Public Constructors
Snackbar.Callback()
Public Methods
void onDismissed(Snackbar snackbar, int event)
Called when the given Snackbar has been dismissed, either through a time-out, having been manually dismissed, or an action being clicked.
void onShown(Snackbar snackbar)
Called when the given Snackbar is visible.
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final int DISMISS_EVENT_ACTION

Indicates that the Snackbar was dismissed via an action click.

Constant Value: 1 (0x00000001)

public static final int DISMISS_EVENT_CONSECUTIVE

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

Constant Value: 4 (0x00000004)

public static final int DISMISS_EVENT_MANUAL

Indicates that the Snackbar was dismissed via a call to dismiss().

Constant Value: 3 (0x00000003)

public static final int DISMISS_EVENT_SWIPE

Indicates that the Snackbar was dismissed via a swipe.

Constant Value: 0 (0x00000000)

public static final int DISMISS_EVENT_TIMEOUT

Indicates that the Snackbar was dismissed via a timeout.

Constant Value: 2 (0x00000002)

Public Constructors

public Snackbar.Callback ()

Public Methods

public void onDismissed (Snackbar snackbar, int event)

Called when the given Snackbar has been dismissed, either through a time-out, having been manually dismissed, or an action being clicked.

Parameters
snackbar The snackbar which has been dismissed.
event The event which caused the dismissal. One of either: DISMISS_EVENT_SWIPE, DISMISS_EVENT_ACTION, DISMISS_EVENT_TIMEOUT, DISMISS_EVENT_MANUAL or DISMISS_EVENT_CONSECUTIVE.
See Also

public void onShown (Snackbar snackbar)

Called when the given Snackbar is visible.

Parameters
snackbar The snackbar which is now visible.
See Also