friends,
can any one guide me how can i enter only alphabets in EditText in android?
any help would be appriciated.
friends,
can any one guide me how can i enter only alphabets in EditText in android?
any help would be appriciated.
Try This
<EditText
android:id="@+id/EditText1"
android:text=""
**android:inputType="text|textNoSuggestions"**
android:textSize="18sp"
android:layout_width="80px"
android:layout_height="43px">
</EditText>
Other inputType can be found Here ..
EditText state = (EditText) findViewById(R.id.txtState);
Pattern ps = Pattern.compile("^[a-zA-Z ]+$");
Matcher ms = ps.matcher(state.getText().toString());
boolean bs = ms.matches();
if (bs == false) {
if (ErrorMessage.contains("invalid"))
ErrorMessage = ErrorMessage + "state,";
else
ErrorMessage = ErrorMessage + "invalid state,";
}