1

I have an edit Text field with an attribute.

android:inputType="numberDecimal"

I want to hide the comma, negative, and space key when the soft keyboard pops up.

I only want the keys availabe to be "0123456789." backspace and enter.

I have tried using android:digits="0123456789."but the comma, negative and space key are still in use.

Also, is there a way to ensure that only one decimal is entered.

  • You should create a custom layout for your keyboard popup,https://stackoverflow.com/a/30054297/11579741 – Ganesh MB Jan 17 '22 at 06:22
  • I Think This is what you want [This Link](https://stackoverflow.com/questions/13817521/how-do-you-set-the-edittext-keyboard-to-only-consist-of-numbers-on-android) – OneDev Jan 17 '22 at 07:09
  • The reason I ask this is because when using number decimal the keyboard should not allow comma, negative, and space key to be used. The number keyboard appears but those key can still be selected. I have checked and I haven't added any programing in the kotlin classes to allow that. – user2066728 Feb 10 '22 at 05:02

0 Answers0