You can try the following:
<EditText android:id="@+id/edit_text_id" android:layout_width="wrap_content" android:layout_height="wrap_content" android:iputType="numbers" />
The possible values ββfor the android:inputType attribute android:inputType in the editing text are: none, text, textCapCharacters, textCapWords, textCapSentences, textAutoCorrect, textAutoComplete, textMultiLine, textImeMultiLine, textNoSuggestions, textUri, textEmailAddress, textEmailSubject, textShortMessage, textLongMessage, textPersonName, textPostalAddress, textPassword, textVisiblePassword, textWebEditText, textFilter, textPhonetic, textWebEmailAddress, textWebPassword, number, numberSigned, numberDecimal, numberPassword, phone, datetime, date, time
RajeshVijayakumar
source share