In this post we will talk about Snackbar.

Snackbars provide lightweight feedback about an operation by showing a brief message at the bottom of the screen. Snackbars can contain an action.

Firstly need to add library or add dependency for gradle.
dependencies {
compile ‘’
You can use Snackbar without Action:
Snackbar.make(findViewById(, “Click”, Snackbar.LENGTH_SHORT).show();
Snackbar without action
If you want add to action to Snackbar you must use setAction function:
Snackbar.make(findViewById(, “Click”, Snackbar.LENGTH_SHORT).setAction(“UNDO”,
new View.OnClickListener() {
public void onClick(View v) {
//some action
Snackbar with action
Layout file for this project

1 CommentClose Comments

Leave a comment

Newsletter Subscribe

Get the Latest Posts & Articles in Your Email

We Promise Not to Send Spam:)