0

Does anyone know how to add a button like this, and keep it showing?

enter image description here

This is my code:

.JAVA

private Button btnNewUser;
private LinearLayout linearLayoutContainer;
//OnCreate....
btnNewUser = findViewById(R.id.newUser);
linearLayoutContainer = findViewById(R.id.linearLayoutContainer);
btnNewUser.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Snackbar
                .make(linearLayoutContainer, "Message in Snackbar!", Snackbar.LENGTH_LONG)
                .show();
            }
        });
Lucas
  • 11
  • 3
  • If the custom UI isn't important, you can just use `setAction(...)` function for the `SnackBar`. If custom UI is important, please follow this answer: https://stackoverflow.com/questions/32453946/how-to-customize-snackbars-layout – theThapa Feb 17 '21 at 22:41
  • I think you're looking for the Bottom Sheet: https://material.io/components/sheets-bottom – TechRando Feb 17 '21 at 22:51

0 Answers0