2

How to set Activity with numeric keyboard,I know that we can specify numeric keyboard for each controls like this

 <EditText a:layout_width="0dip" a:id="@+id/priceTextBox"
              a:layout_height="40dip"
              a:layout_weight="20" a:singleLine="true"
              a:focusable="true"
              a:inputType="number" a:numeric="integer"


            />

But requirement is activity itself need numeric keyboard not each controls.How to specify like that? Kindly assist..

TNR
  • 5,839
  • 3
  • 33
  • 62
Rockin
  • 723
  • 4
  • 25
  • 51

2 Answers2

0

You can use a KeyboardView : https://stackoverflow.com/a/11923742/1970317
Hope it helps.

Community
  • 1
  • 1
EvZ
  • 11,889
  • 4
  • 38
  • 76
0

An activity can't process input by itself, so what do you want to achieve? A less dynamic screen layout?

Either way, you may want to read about the InputMethodManager which allows you to force the keyboard to open, e.g. by calling showSoftInput(View view, int flags, ResultReceiver resultReceiver) which also allows you to specify a reveiver for the input. You'll need a View, though. I'd try to set up a view for solely numeric input and hide it.

class stacker
  • 5,357
  • 2
  • 32
  • 65