android:inputType=“textEmailAddress” - '@' key and a '.com' key?

后端 未结 3 1277
不思量自难忘°
不思量自难忘° 2020-12-11 16:14

I\'m having an EditText where I set the inputType=\"textEmailAddress\". My understanding is that this should bring up a soft keyboard that\'s more suitable for email address

相关标签:
3条回答
  • 2020-12-11 16:39

    There is no "default" really. android:inputType is merely a hint for your IME. Now that IME could be the stock Android 1.1 keyboard, the Android 2.0 keyboard, the HTC Sense keyboard, SwiftKey, Swype, you name it. Each one can decide for itself whether or not to add a ".com" key (or to entirely ignore inputType).

    0 讨论(0)
  • 2020-12-11 16:45

    Android's own SDK has an example of using inputType to modify behaviour (see: http://developer.android.com/resources/samples/SoftKeyboard/src/com/example/android/softkeyboard/SoftKeyboard.html)

    Interestingly, KeyEvent does not have a specific key code for the '.com' key in the question. I assume it uses an unused key code for this purpose.

    0 讨论(0)
  • 2020-12-11 16:47

    Try this, it might help you

    editText.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS);
    
    0 讨论(0)
提交回复
热议问题