EditText edittxtpassword = findViewById(R.id.edittxtpassword); edittxtpassword.setTransformationMethod(new MyPasswordTransformationMethod()); public class MyPasswordTransformationMethod extends PasswordTransformationMethod { @Override public CharSequence getTransformation(CharSequence source, View view) { return new PasswordCharSequence(source); } private class PasswordCharSequence implements CharSequence { private CharSequence mSource; public PasswordCharSequence(CharSequence source) { mSource = source; } public char charAt(int index) { return '*'; } public int length() { return mSource.length(); } public CharSequence subSequence(int start, int end) { return mSource.subSequence(start, end); // Return default } } }; source : https://wordpress.com/post/qforce519945958.wordpress.com/236