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
0
votes
1 answer

(android) how to close an activity after snackbar ended?

i want to close activity after snackbar is over. i have two activties A and B. A activity is open B activity using intent. at B, when snackbar is over in 3 seconds, B is close automatically using finish(). But how to know that snackbar is over? as…
ybybyb
  • 1,385
  • 1
  • 12
  • 33
0
votes
1 answer

Flutter: Pop from AlertBuilder and then show SnackBar

I am new in Flutter as well as App Development, What I want to achieve is Show SnackBar after poping from alertbuilder. I think following code will be useful for understanding my intentions onSubmitted: (value) async { …
0
votes
1 answer

How to add error handling in angular 8 using snackbar without using centralized error handling

I have this code in client.add.component.ts and want to do error handling for Duplicate entry. I get 503 error in console currently. this.clientsSvc.createClient(client).subscribe(x => this.router.navigate(['../'], {relativeTo: this.route})); How…
smiti
  • 31
  • 3
0
votes
2 answers

Android SnackBar not shown before Activity recreate

In my android app I have a button, which changes the language. After clicking the button, the activity is recreated to apply the language changes. I need to show a message to user via SnackBar, that the language has changed. Till now I used a Toast…
Darksymphony
  • 2,155
  • 30
  • 54
0
votes
1 answer

How to show a SnackBar when the Form opens in Flutter

I would like to show a SnackBar when a form opens with instructions as to how to interact with the form. I tried to use FlushBar, and it kind of worked, because the SnackBar appeared but not dismissed itself after the duration I set, and it…
CMorgado
  • 73
  • 1
  • 6
0
votes
1 answer

Android how to call Activity data type from another class in Main Activity?

I have this code separate class which makes a Snackbar to be displayed within my application, But with my current implementation I am getting a 'java.lang.NullPointerException'. How do I implement it in my main class properly? here is my snack bar…
Reaper
  • 35
  • 5
0
votes
1 answer

iOS Swift : Material Snackbar showing behind child popup view

I am trying to use material snackbar. Everything works fine if snackbar toast message is shown directly on a view controller. However when a child pop up view is appended to the view (view.addSubView), and the toast is triggered from the child popup…
0
votes
1 answer

How do I display Facebook Login status in a snackbar?

In my flutter app after logging in with Facebook SignIn, I want the user to go to the next screen if login was successful but if canceled or there is an error show a snackbar with the details. I have managed to move the user to the next screen if…
maykhid
  • 129
  • 1
  • 10
0
votes
1 answer

Scaffold.of() called with a context that does not contain a Scaffold. problem

i try to create a snackbar on scaffold, but error was Scaffold.of() called with a context that does not contain a Scaffold. and i can't solve it,i try to put a key but there is an error on it and can't setup an key, this is my code: class Login…
AhdOthman
  • 47
  • 4
0
votes
3 answers

C# Snackbar as Dialog

I want to use the Snackbar from any thread. I declared my Snackbar as i should her; https://github.com/MaterialDesignInXAML/MaterialDesignInXamlToolkit/wiki/Snackbar The Wiki says that I can only access the Snackbar from a Dispatcher thread, but how…
tuke307
  • 411
  • 5
  • 13
0
votes
1 answer

Calling appUpdateManager.completeUpdate() can crash my app if I move to a different fragment / activity

I've been recently trying out Android's in-app-update API here https://developer.android.com/guide/playcore/in-app-updates and calling appUpdateManager.completeUpdate() this method after successfully downloading the update seems to work, if I stay…
Mike
  • 1,313
  • 12
  • 21
0
votes
0 answers

Call View.OnClickListener from Snackbar

I am trying to call ViewModel from my activity in a snackbar and since it requires a onClickListener it doesn't let me just do a simple Snackbar.make(mViewBinding.root, "Note has been deleted", Snackbar.LENGTH_LONG).apply { setAction("Undo",…
Barrufet
  • 495
  • 1
  • 11
  • 33
0
votes
0 answers

Trigger Snackbar on external file creation/update

I am a newbie. in Angular, I have implemented a snackbar where click event triggers it for 3 seconds. This however is not what I exactly need. I am to receive values from a Python code in JSON/text form. As soon as the file is recieved/changed, it…
0
votes
1 answer

can't change the value of the variable in snackBar

the variable should get value false at hint 1 but when it checked in the if statement at hint 2 is still true enter image description here
0
votes
0 answers

Snackbar doesn't show up if onPressed has more code in it

At first I encountered the issue that the Scaffold.of(context) referred to the wrong context. I implemented the Builder widget properly. The error message was gone but the snackbar still doesn't show up. My first thought was that I've done something…
Chris Pi
  • 536
  • 1
  • 5
  • 21