Andz
Andz

Reputation: 11

How do I open numeric keypad when edittext selected and input multiple numbers? inputStyle="number" limits the quantity of numbers to one

I am making a math program that reads in numbers from an edittext box, and creates / LU factors a matrix. When a user clicks into this field, the regular keyboard shows. It would be easier for the user if it were a numeric keyboard. When I use android:inputStyle="number" the amount of numbers allowed to be entered into the field is 1. How do I bring up the numeric keyboard without limiting the ability to enter multiple numbers?

Upvotes: 1

Views: 4718

Answers (3)

S.A.Jay
S.A.Jay

Reputation: 421

android:numeric has been depreciated. (From Google: android:numeric If set, specifies that this TextView has a numeric input method. * Deprecated: Use inputType instead.)

android:inputType="number" seems to work great for me. There are a lot of options as well. (From Google: The type of data being placed in a text field, used to help an input method decide how to let the user enter text.)

Upvotes: 2

peter.o
peter.o

Reputation: 3530

android:inputType="numberDecimal"

Upvotes: 0

Opy
Opy

Reputation: 2109

Add this in each numeric edittext in your layout file:

android:numeric="decimal"

Upvotes: 3

Related Questions