numeric

Android Edittext Inputtype

Edittext inputtype is used to set your input type for edittext.

Ex:- You can set your edittext inputtype as 'Phone'. So that user can able to type only numbers.

Android Edittext Numeric

We can set edittext to only allow integer values using edittext property 'numeric'.

[sourcecode language="xml"]

<EditText android:text="435.569"
android:id="@+id/EditText01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:numeric="integer|decimal" />

[/sourcecode]

Here the numeric is both 'interger & decimal'. So it will accept only the integer & decimal values.

Syndicate content