0

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 this would also disable the textPassword features of replacing password rendering to "*[lastchar]".

Is there any other way to disable the softKeyboard from showing up?

icyerasor
  • 4,973
  • 1
  • 43
  • 52
  • No slideout keyboard? No can use my app!!!! – Lee Louviere Apr 06 '11 at 22:19
  • The usecase is for a PIN-Input where the Numbers are Buttons that are displayed on the Screen. I usually would let the user use the slideout keyboard or the softkeyboard, but our customer wants to use the onscreen buttons only. – icyerasor Apr 07 '11 at 08:36

1 Answers1

1

Uhm just figured it out myself:

Simply use:

pinInput.setOnClickListener(new OnClickListener() {
      public void onClick(View v) {
            InputMethodManager mgr = (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.

icyerasor
  • 4,973
  • 1
  • 43
  • 52