Chathura Wijesinghe Chathura Wijesinghe - 1 year ago 823
Android Question

Android Snackbar TextAlignment in Center

enter image description here

How to change the Snackbar text alignment to center ? bellow code is not working

Snackbar snack = Snackbar.make(findViewById(, intent.getStringExtra(KEY_ERROR_MESSAGE), Snackbar.LENGTH_LONG);
View view = snack.getView();
TextView tv = (TextView) view.findViewById(;
tv.setTextColor(ContextCompat.getColor(LoginActivity.this, R.color.red_EC1C24));

Answer Source