kehnar
kehnar

Reputation: 1387

how to get soft keypad to write email id in edittext in android

I am using android:phoneNumber to open soft keypad to get phone number in android.I want to open keypad which contains all key required to write email id in edittext.So is there any solution for this(email) like phone number. Thank you

Upvotes: 4

Views: 2324

Answers (3)

Mason Lee
Mason Lee

Reputation: 5140

Use textEmailAddress (0x00000021) as defined here: http://developer.android.com/reference/android/widget/TextView.html

In Java code:

 myEditText.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS);

In XML properties:

 android:inputType="textEmailAddress"

Upvotes: 9

Niranj Patel
Niranj Patel

Reputation: 33248

you can set property Input Type for EditText

Image of Input Type

Upvotes: 2

Pinki
Pinki

Reputation: 21929

use the below code for getting the email soft keyboard

Editetxt email=(EditText)findViewById(R.id.edotetxtemail)
email.setInputType(InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS);

Upvotes: 2

Related Questions