I have an edittext which is created programmatically (so not in xml) and I want to launch a numeric keyboard when user presses it. The problem is that I want this keyboard also to contain the decimal separator (.).
I tried many things but nothing seems to work
final EditText input = new EditText(this);
input.setKeyListener(new DigitsKeyListener()); // this gives numeric without decimal separator input.setInputType(InputType.TYPE_CLASS_NUMBER); // this gives numeric without decimal separator input.setInputType(InputType.TYPE_CLASS_PHONE);//this gives phone keyboard with all the digits and decimal separator in the second page. It is not exactly what I want
I know that there is a way to implement custom keyboard:
http://android-developers.blogspot.com/2009/04/creating-input-method.html
http://developer.android.com/resources/samples/SoftKeyboard/index.html
but it seems quite a pain and I am first looking for a quicker alternative.
All I want is one of the following: 1. Launch numeric keyboard that contains decimal separator 2. Launch standard keyboard, but set in the numeric "page" Is something of the above possible? Thank you in advance!