Android SnackBar with Action Example
void showSnackBarWithMessage()
{
String message = "Message";
final Snackbar snack = Snackbar.make(layoutWebView, message, 2000);
snack.getView().setBackgroundColor(ContextCompat.getColor(this, R.color.purple_700));
snack.setAction("OK", new View.OnClickListener() {
@Override
public void onClick(View view) {
snack.dismiss();
}
});
snack.show();
}
No comments:
Post a Comment