Oneiros
Oneiros

Reputation: 4378

Android - Numeric (float) soft keyboard

I need to insert in an EditText some numeric data with decimal. I know that i could insert this:

android:inputType="numberDecimal"

in my xml file. But I'd like a different keyboard with only numeric (and point) keys. Something like the "phone" keyboard (android:inputType="phone").

I know, this is a duplicated question (here the original) but i decided to open a new one because the first one doesn't look to have a good solution.

Upvotes: 1

Views: 2943

Answers (1)

pawelzieba
pawelzieba

Reputation: 16082

It depends on keyboard app, which is installed on your device, which buttons are visible for different inputTypes. You can't simply override default keyboard due to security issues. But you can create your own implementation. But it needs to be registered by user in settings.

There is how to do it:
http://android-developers.blogspot.com/2009/04/creating-input-method.html

And sample keyboard:
http://developer.android.com/resources/samples/SoftKeyboard/index.html

Upvotes: 1

Related Questions