How to force EditText to accept only numbers? February 13, 2023 by Tarik Use android:inputType="number" in your layout XML