I develop own library module where I use Snackbar
.
Here is my Gradle file:
apply plugin: \'com.android.library\'
android {
compileSdkV
After upgrading to androidx it will show error.You have to import this library
import com.google.android.material.snackbar.Snackbar;
Snackbar snackbar = Snackbar.make(view, R.string.Mapview, Snackbar.LENGTH_INDEFINITE);
View snackbarView = snackbar.getView();
TextView textView = (TextView) snackbarView.findViewById(com.google.android.material.R.id.snackbar_text);
textView.setMaxLines(5);
snackbar.show();
Hope it will solve your problem.