Questions tagged [android-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

477 questions
-1
votes
1 answer

How to have an alert similar to Twitter Toast/Snackbar alert in Android Studio?

How one can have Toast/Snackbar notification UI like Twitter Toast/Snackbar notification in android studio (java or kotlin)?
-1
votes
1 answer

Android - show message after form submit and go to another Activity

I have a simple form in Android, and I want to show a message after clicking the Submit button and after some time it should go to another activity. My code: public void submitbuttonHandler(View view) { boolean isAllFieldsChecked =…
Darksymphony
  • 2,155
  • 30
  • 54
-1
votes
1 answer

Snackbar action gets null pointer after moving to another fragment

Fragment A invokes a snackbar with an action button. When user clicks action, it starts new activity with intent. It's working fine. However, if the user moves to Fragment B while snackbar keeps appearing, then press action button, now it doesn't…
Tieria
  • 333
  • 3
  • 11
-1
votes
1 answer

Snackbar Overlapping Floating Action Button Through Fragment Navigation

I've having an strange issue of Snackbar overlapping a floating action button that I have in the main view of the application. For context, I will provide a short clip of the issue I'm experiencing. I initiate the snackbar from a separate fragment…
-1
votes
3 answers

How to use Material Snackbar in my application?

I have followed the guidelines to how to implement Material Components to my app and have assigned the Theme.MaterialComponents.NoActionBarto my AppTheme and in my main activity it has a CoordinatorLayout as mentioned in material.io to best display…
-1
votes
2 answers

Floating Action Button is duplicated in fragment

In a project, there was a FloatingActionButton in one of the activities. I attempted to add a Fragment in that activity and move the FAB inside that Fragment. Everything seemed to be OK, however when I tried to display a SnackBar, I noticed there…
-1
votes
1 answer

How to show snackbar throughout the Application?

I have more than 3 Activity but let's just take three of them, BaseActivity, Splashscreen, MainActivity. Splashscreen and Mainactivity extends BaseActivity. Now i am showing a Snackbar inside the BaseActivity whenever I get failureresponse from the…
Aman Verma
  • 3,155
  • 7
  • 30
  • 60
-1
votes
3 answers

Can't click action button on Snackbar

Can't click the button on SnackBar inside fragment with data binding. Here's java code: final Snackbar snackBar = Snackbar.make(binding.layoutMain, error, Snackbar.LENGTH_LONG); snackBar.setAction("TRY", new View.OnClickListener() { …
-1
votes
3 answers

I can`t code setAction on CustomSnackbar in Android

I have a CustomSnackBar class and an Activity that i want to show a Snackbar in that Activity. I have a custom layout for snack bar but i have a problem when i code setAction in my CustomSnackBar and my error is: java.lang.RuntimeException: Unable…
Mohammad Davari
  • 430
  • 3
  • 13
-1
votes
3 answers

Snackbar like google io 2018 android

How can I implement such a snackbar. To have it with round edges and show above fab and was not stretched across the width of the screen
-1
votes
1 answer

How to fade out SnackBar bottom to top

I have the following Activity where users can post comments. If there is no internet connection I am showing message to user in a SnackBar on top of the screen because at the bottom I have EditText. Now the problem is that SnackBar is fading out…
Abdurakhmon
  • 2,813
  • 5
  • 20
  • 41
-1
votes
1 answer

Can't resolve Snackbar with API24?

Im trying to implement the new Snackbars in my app but I can't Why I can't use (Snackbar)?I want to create the RuntimePermission for my application.Here is my V24 details adroid version 2.3.1Thanks android { compileSdkVersion 24 …
-1
votes
2 answers

Where is an Android Snackbar that will enter from right

I try to find a Android snackbar typ of widget that will enter not from top or bottom but from right or left. Further demands is custom message, icon, stacking, dismiss button, callback handlers. The thing is when snackbar is popping up from the…
Tord Larsen
  • 2,670
  • 8
  • 33
  • 76
-1
votes
2 answers

Snackbar shown under view

I am using snackbar to alert user on exiting application, It works well on most of devices but on few devices like GALAXY A5(android version 5.0.2) it goes under my view like what's the problem?
masoud vali
  • 1,528
  • 2
  • 18
  • 29
-1
votes
1 answer

Coordinatorlayout is null

hi im making an app which will show a snackbar for the user when he/she opens the app for the first time i instalized the coordinator layout and did every thing right but the app crashes on my phone and tells me that im attempting to invoke a…
Tarek Zoubi
  • 53
  • 1
  • 9
1 2 3
31
32