Skip to content Skip to sidebar Skip to footer

Edittext With Textpassword Inputtype, But Without Softkeyboard

i wanted to create an EditText with an android:inputType='textPassword. However i also do not want to use the SoftKeyboard for input. So i tried setting InputMethod to null, but th

Solution 1:

Uhm just figured it out myself:

Simply use:

pinInput.setOnClickListener(newOnClickListener() {
      publicvoidonClick(View v) {
            InputMethodManagermgr= (InputMethodManager) Pin.this.getSystemService(Context.INPUT_METHOD_SERVICE);
            mgr.hideSoftInputFromWindow(v.getWindowToken(), 0);
      }
    });

This works well for me. I feared it might show the SoftKeyboard and then hide it again instantly, or flicker the screen, but does nothing like it.

Post a Comment for "Edittext With Textpassword Inputtype, But Without Softkeyboard"