Questions tagged [snackbar]

Snackbars provide lightweight feedback about an operation. They show a brief message at the bottom of the screen on mobile and lower left on larger devices. Snackbars appear above all other elements on screen and only one can be displayed at a time.

Introduction

Snackbars provide lightweight feedback about an operation. They show a brief message at the bottom of the screen on mobile and lower left on larger devices. Snackbars appear above all other elements on screen and only one can be displayed at a time.

They automatically disappear after a timeout or after user interaction elsewhere on the screen, particularly after interactions that summon a new surface or activity. Snackbars can be swiped off screen.

Snackbars can contain an action which is set via setAction(CharSequence, android.view.View.OnClickListener).

Documentation

Usage of SnackBar

493 questions
-1
votes
1 answer

How to add Snackbar where View Class is not directly accessible

I am facing a problem while adding a Snackbar in my code. Actually I want to show a Snackbar in ItemTouchHelper Object. I am using ItemTouchHelper to remove items on swipe and then show a Snackbar that item is removed. How to add a Snakbar where I…
Shoaib Kakal
  • 1,090
  • 2
  • 16
  • 32
-1
votes
2 answers

Success or error toast after running function in Javascript

I have two functions which look like this: function functionOne(par1, par2, par3) { // this functions patches using an api, re-usable } function functionTwo(par2) { functionOne(par1, par2, par3); functionOne(par1, par2, par3); functionOne(par1,…
narodel
  • 5
  • 1
  • 7
-1
votes
1 answer

Snack Bar not working flutter NoSuchMethodError

I am a flutter newbie tried creating a Snackbar by creating Global key call _scaffoldkey and appending it to the scaffold. I then tried tried creating a snack bar using this key but it isn't working, I got a feedback saying "NoSuchMethodError : The…
V-Ghost
  • 69
  • 1
  • 4
-1
votes
2 answers

Cannot resolve Snackbar.make() in setOnclicklistener with lambda

I was trying to add Snackbar type message for my actions, When i used Snackbar it gives error cannot resolve make(). Snackbar.make(this,"Field should not be empty ",Snackbar.LENGTH_SHORT).show(); But this gives error cannot resolve method…
-1
votes
1 answer

How do I implement a snackbar in a global listener?

I am using an event listener in my main activity to determine network connectivity with the database //Main Activity new MyListener() { if (connected) { Log.d(TAG,"connected"); …
isopropylcyanide
  • 423
  • 4
  • 16
-1
votes
2 answers

Can't resolve method setAction() error in Snackbar

I made a function of Snackbar : void openSnackbar(String title){ Snackbar .make(findViewById(R.id.coordinatorLayout), title, Snackbar.LENGTH_LONG) …
Yeahia2508
  • 7,526
  • 14
  • 42
  • 71
-1
votes
1 answer

Snackbar with setOnLongClickListener

I want to be able to show a snackbar when a button is long pressed. I have a FAB that behaves perfectly but this won't work. (Ignore the orderCounter and +100. That is another part of the long press.) Button plusButton = (Button)…
-2
votes
1 answer

Android - How to make a pop up message notification like this?

The pop up message is the Green one. I tried to use snackbar but many says Snackbar cant make custom layout and Toast doesnt have an action. So what should I use to make that green pop up message?
Zen Ryuu
  • 21
  • 4
-2
votes
1 answer

How to disable background in Angular snackbar?

I want to disable background options while angular snackbar is being displayed. How to achieve this in angular 10?
Raja Sekaran
  • 397
  • 4
  • 10
-2
votes
4 answers

closing a snackbar on clicking a button other than action button of it in android

I display a snackbar using the code Snackbar.make(rootView, mMessage, Snackbar.LENGTH_LONG) .make(rootView, mMessage, Snackbar.LENGTH_INDEFINITE) .setAction("Action", null) .show(); This snackbar is…
Devrath
  • 42,072
  • 54
  • 195
  • 297
-2
votes
1 answer

Why View.Gone not working in Snackbar?

I have a snackbar in which i want to remove textview but when i am using View.INVISIBLE then it is not showing uo but when using View.GONE then app is crashing by saying NullPointerException. Why so? Here is the code MainActivity.java Snackbar…
Ankit Srivastava
  • 135
  • 4
  • 11
-2
votes
1 answer

snackbar with custom Function call in Swift

I am using snackBar in my app, it's working fine in my application but I want to access the Custom Function from SnackBar Action Block. I can try that it's showing Instance member 'uncheck' cannot be used on type 'DetailsInfoViewController' did…
naga
  • 397
  • 2
  • 12
  • 26
-3
votes
1 answer

Snackbar shown along with Toast

I am using Google's design support library to show Snackbars. After I compile the apk and run it on phone (Nexus 5), the Snackbar is shown along with the Toast. Running directly from Android Studio works fine (only Snackbar is shown). Any help will…
1 2 3
32
33