title: Android - Comma as decimal separator on Numeric Keyboard
body: <p>We need to have a numeric keyboard for an <code>EditText</code>. The Keyboard should have decimal separator based on the device's selected locale. We implemented this by setting the custom <code>DigitsKeyListener</code> to the <code>EditText</code></p>
  
  <pre><code>public class NumericDigitsKeyListener extends DigitsKeyListener {
  
  
      @Override
      protected char[] getAcceptedChars() {
  
          char[] acceptedCharacters = null;
  
              acceptedCharacters =  new char[] {
                      '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
                      new DecimalFormatSymbols(Locale.getDefaultLocale()).getDecimalSeparator()
  
          return acceptedCharacters;
      }
  
      /**
       * @see android.text.method.DigitsKeyListener#getInputType()
       */
      public int getInputType() {
          return InputType.TYPE_CLASS_NUMBER | InputType.TYPE_NUMBER_FLAG_DECIMAL;
      }
  </code></pre>
  
  <p>The above seems to work fine for most of the devices however for Samsung Galaxy S-II, the softkeyboard does not have comma in the keyboard.Th swype keyboard of the device displays the comma, but the default one does not.</p>
  
  <p>I have tried overriding DigitsKeyListener as mentioned <a href="https://stackoverflow.com/a/10498873">here</a></p>
  
  <p>Is there a way I can enforce all the devices to have comma (when applicable or even always) to be there on numeric keyboard?</p>