Search code examples
androidandroid-edittextandroid-softkeyboard

EditText with PasswordTransformationMethod, keyboard gives suggestion revealing password


In my android application, I have some EditTexts. Those EditTexts will serve as password fields, but I've not marked them as password fields in the attributes, so that the font of hint text matches the font of hint in normal EditText widgets.

The problem I have though is that the password is revealed in the keyboard suggestion while it is typed, although it is hidden as I've used:

EditText.setTransformationMethod(new PasswordTransformationMethod());

What should I do to disable those suggestions?


Solution

  • I had already fixed it, but didn't have time to come and answer the question. For anyone who is struggling with this, adding the following attribute to the EditText will work:

    android:inputType="textNoSuggestions"