views:

3465

answers:

3

I just basically want to switch to the number pad mode as soon a certain EditText has the focus.

+10  A: 

You can configure an inputType for your EditText:

<EditText android:inputType="number" ... />
Josef
That's surprisingly easy.cheers
Chiwai Chan
Also note that you need to target Android 1.5 to use this (it's not available in 1.1)
Wilka
A: 

How can I do it in .java file because i m generating a editbox dynamically.

Jyothi Attaluri
+1  A: 

To do it in a Java file:

EditText input = new EditText(this);
input.setInputType(InputType.TYPE_CLASS_NUMBER);
Dominic