0

I need to display negative and positive values inside an TextInputEditText. I am setting the inputType programatically:

inputTypeEditText.setInputType(InputType.TYPE_CLASS_NUMBER | 
InputType.TYPE_NUMBER_FLAG_DECIMAL);

the above code works for positive float numbers only.

And also I tried

inputTypeEditText.setInputType(InputType.TYPE_CLASS_NUMBER | 
InputType.TYPE_NUMBER_FLAG_SIGNED);

but this keyboard is similar with the text keyboard and shows to much characters.

aurelianr
  • 538
  • 2
  • 12
  • 35

1 Answers1

0

I made the float keyboard which displays float positive and negative numbers using the following code:

inputTypeEditText.setInputType(InputType.TYPE_NUMBER_FLAG_SIGNED|
           InputType.TYPE_CLASS_NUMBER|InputType.TYPE_NUMBER_FLAG_DECIMAL);
aurelianr
  • 538
  • 2
  • 12
  • 35