What is snackbar in android ?

    0
    32

    Snackbar is the component of Material design introduced in android. Snackbar provides the lightweight feed of any operation occurs in an activity. They show a message in the bottom of the Activity. Snackbar appears on top of all the elements.

    Wants to Learn Android application development from the scratch  ?

    in the above picture “Article Saved Offline” is the Snackbar.

    Let’s Know how to create Snackbar in android

    Snackbar snackbar = Snackbar .make(linearLayout, "Article Already Saved Offline!", 12000)
    .setDuration(12000)
    .setAction("View", new View.OnClickListener() {
    @Override public void onClick(View view) {
    Intent intent=new Intent(NewsView.this,OfflineArticles.class);
    startActivity(intent);
    }
    });
    snackbar.show();

    Related:

    Android Custom Toast Example

    Create custom dialog box in android

    Circular Imageview in Custom Listview in Android

    Designing Custom tableView Cell or Designing an article reading app

    Android Custom Fonts in Android Application

    If you really liked the article, please subscribe to our YouTube Channel for videos related to this article.Please find us on Twitter and Facebook.

    LEAVE A REPLY

    Please enter your comment!
    Please enter your name here