Noby
Noby

Reputation: 6602

Why input type "number" is showing alphabet keyboard for an edit text...?

I have a edit text, whose input type is number.

in emulator its working fine i.e, showing the num-pad as soft keypad.

but in the device its showing alphabets keyboard why?

<EditText android:layout_width="110dp"
                android:layout_height="30dp" android:id="@+id/phone"
                android:layout_alignParentRight="true" android:background="@drawable/edit_text_bg"
                android:inputType="number" android:maxLength="10"
                android:paddingLeft="4dp" android:textColor="#1b0a00" 
                android:layout_marginRight="8dp"/>

Thanks in advance....!

Upvotes: 2

Views: 3466

Answers (4)

Murohy
Murohy

Reputation: 11

I think you must change inputType

FROM : android:inputType="number"

TO: android:inputType="phone"

Upvotes: 1

Saiesh
Saiesh

Reputation: 641

So from what i've observed setting the inputType to phone should solve the problem . But try a different device to check if ur code works by giving input as number before moving to this option .

Upvotes: 1

Saiesh
Saiesh

Reputation: 641

When you give the InputType as number there is a completely new keyboard that gets loaded very different to what you will get by pressing the corner button on your normal keyboard to get numbers . Only certain phones/android versions(i think 2.2+) have this separate keyboard . For the ones that dont have this , The normal keyboard is shown and manual switching has to be done .

Upvotes: 0

Kurtis Nusbaum
Kurtis Nusbaum

Reputation: 30825

It could be that the device you're testing has some sort of custom keyboard enabled by default that doesn't support a number pad. Try changing the keyboard settings to the standard keyboard on the device and see if it works.

Upvotes: 0

Related Questions