问题
The following Code doesn't seem to work,I want the email keyboard with @ and .com to get displayed for the edit text.
emailEditText.setInputType(InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS);
回答1:
Add this to your layout:
android:inputType="textEmailAddress"
回答2:
Well I found the solution which is to use
emailEditText.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS);
来源:https://stackoverflow.com/questions/11204120/email-keyboard-for-edit-text