Android Hide keyboard for password field

When setting a setInputType(InputType.TYPE_NULL);password field, the text that we enter is visible and points that are not desirable for the password field will not be masked.

InputType.TYPE_NULL | TYPE_TEXT_VARIATION_PASSWORD displays the keyboard.

If we try to set the content type as TYPE_TEXT_VARIATION_PASSWORDagain, the virtual keyboard will appear again.

Also tried the method below, which also does not work. InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); imm.hideSoftInputFromWindow(editTextPasswordnew.getWindowToken(), 0);

Installation InputTypein NULLand installation TransformationMethod still displays locale prompts.

Can you suggest any other possible ways how we can achieve hiding the virtual keyboard in the password field EditText?

We do not want the user to do this from the settings.

+3
source share
2 answers

android:windowSoftInputMode activity AndroidManifest.xml. stateHidden stateAlwaysHidden.

, .

0

. , , .

android:editable="false"
android:password="true"
0

All Articles