I am using android design support library Snackbar
using following code.
Snackbar.make(rootView, "Sample Snackbar", Snackbar.LENGTH_LONG)
.setAction("OK", view -> {})
.setDuration(Snackbar.LENGTH_INDEFINITE)
.show();
On Android 4.4 I am getting it like this:
I am not sure what am I doing wrong here.
.setAction("OK", view -> {})
contains a lambda expression in the 2nd parameter. its just a empty listener.
I just had the same problem using FrameLayout as root view on a real device (android 6.0) when showing the snackbar inside a dialog. After changing it to
android.support.design.widget.CoordinatorLayout
the problem went away and the snackbar is showing correctly.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.