Allow only decimal numeric input and use phone soft keyboard?

by Watter » Fri, 23 Apr 2010 08:03:48 GMT

Sponsored Links
 I am trying to do something that I thought would be simple, yet I
still haven't found the right approach.

I have a EditText field that should only accept unsigned decimal
entries. Using android:inputType="numberDecimal" in my layout xml file
achieves this, however the soft keyboard that is raised with this
inputType is the standard keyboard but just uses the alternate view
with the number row on top. This is far from ideal for a field that
only allows numbers. A much better soft keyboard for numeric entry is
the "phone" one. It has all of the numbers and a decimal. Perfect!!
Well, except that for the life of me I cannot figure out how to use
both the phone keyboard AND allow only numeric entry. I've tried
everything I can think of but if I use the phone soft keyboard then
the input field also allows things like "(" and any of the other
symbols available on that keyboard.

Is there any way to get the nice big numeric buttons of the phone
keyboard along with only allowing decimal entry?


Other Threads

1. Kristen schaal

Habis liat channel ini...hh android saya serasa sangat atari :(

a10 _o


2. Confused by @Override

Hi-- I am not very experienced with Java, and I am confused about overriding 
a method. I am trying to override the OnBufferDraw() method by extending 
KeyboardView, like this:

  public class PhoneticKeyboardView extends KeyboardView {

       private void onBufferDraw() {
            if (mBuffer == null || mKeyboardChanged) { ...

But when I compile it I get an error:

  cannot find symbol
    [javac] symbol  : variable mBuffer
    [javac] location: class
    [javac]         if (mBuffer == null || mKeyboardChanged) {
    [javac]             ^

Which I don't understand b/c mBuffer is defined in KeyboardView. What am I 
doing wrong. Surely I do not have to redefine every class variable of the 


3. Internet for the App

4. The server could not process your apk. Try again. (again...)

5. installing sdk

6. Android 3.0 Starter Pack - XML Verification Error

7. Regarding Image Fetching