I need to create a SnackBar that requires the user to click to dismiss. How do I do that? The following won’t compile and I don’t want to make the SnackBar variable a field.
final Snackbar snack = Snackbar.make(findViewById(R.id.notAvailable),
"You don't have this feature",
Snackbar.LENGTH_INDEFINITE)
.setAction("OK", new View.OnClickListener() {
@Override
public void onClick(View v) {
snack.dismiss();
}
});
snack.show();