2

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....!

Noby
  • 6,562
  • 9
  • 40
  • 63

4 Answers4

1

I think you must change inputType

FROM : android:inputType="number"

TO: android:inputType="phone"

Murohy
  • 11
  • 1
1

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 .

Saiesh
  • 641
  • 2
  • 7
  • 23
0

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.

Kurtis Nusbaum
  • 30,445
  • 13
  • 78
  • 102
  • i am using default android keyboard, it has num pad also, but we need to select after keyboard pop ups..! but i want it when i select the edit text. – Noby Oct 20 '11 at 14:23
  • @Noby I'm sorry I don't understand your comment. – Kurtis Nusbaum Oct 20 '11 at 14:26
  • i am using input method as "android keyboard" in my device. it has a button at corner for number pad, if we click on that button number pad will come. I want that key pad should come when i click on my edit text. – Noby Oct 20 '11 at 14:32
  • Just try to press long on the input field and then select input method -> Android keyboard. Is there another option selected? Your code looks good... What device are you using? – Mark Oct 20 '11 at 18:20
  • I am using Alcatel OT 890, after changing also no effect. – Noby Oct 31 '11 at 10:15
0

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 .

Saiesh
  • 641
  • 2
  • 7
  • 23
  • Are you sure about this...? Where can i find more details about this. If you any sources, can you please share with me...? – Noby Nov 01 '11 at 06:53
  • Not sure if this will help you but worth reading http://stackoverflow.com/questions/1654901/does-android-have-a-numeric-keypad – Saiesh Nov 01 '11 at 08:07