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. How to write ContentProvider for content not stored in a file nor DB?

Hi,
I'm writing a ContentProvider that will provide content that is not
stored in a file or database.

I understand hat I have to overwrite openAssetFile() method.

My problem is that I don't know how to create AssetFileDescriptor from
data in memory (byte array or stream).

Can anybody please point me to the right direction?

I was digging in Android source where they use MemoryFile but I can't
obtain ParcelFileDescriptor from MemoryFile :(.

Any help greatly appreciated.

Thanks.

2. Android Bug: Time.parse3339 crashes BEFORE it throws a TimeFormatException!

I just confirmed that this is fixed in 2.0.1!

3. Android Bug: Time.parse3339 crashes BEFORE it throws a TimeFormatException!

4. REPOST WTS: Motorola milestone 2nd 6,9jt

5. Android Bug: Time.parse3339 crashes BEFORE it throws a TimeFormatException!

6. Virtual Camera + Accelerometer + 3ds max

7. Common Component Externalization