0

I have a few problems with EditText only on the Samsung Galaxy Fame device. In the screenshot you will see these two bugs:

editText bug http://ubuntuone.com/1vcvZkZevshNLvl4DvBNJ5

Bug №1: The RTL is disabled in the manifest, gravity is not set as "right", but when you add new symbols, they are placed at the right side of EditText.

Bug №2: Last character should be "0", and not inversed "?" question mark symbol. P.S: I'm using standard font.

Upd: All input is donу via custom keypad layout, so I simulate key pressing with a next lines:

long eventTime = System.currentTimeMillis();
KeyEvent keyEventDown = new KeyEvent(eventTime, eventTime, KeyEvent.ACTION_DOWN, 
    keyCode, 0, 0, 0, 0,
    KeyEvent.FLAG_SOFT_KEYBOARD | KeyEvent.FLAG_KEEP_TOUCH_MODE);
targetActivity.dispatchKeyEvent(keyEventDown);

Upd2: The problem is in the dispatchKeyEvent method:

@Override
public boolean dispatchKeyEvent(KeyEvent event) {
    if(event.getKeyCode() == KeyEvent.KEYCODE_0){
       //I can add "0" to editText here, but this is only backup plan. 
       return true;
    }
    super.dispatchKeyEvent(event);
    return true;
}
Johan
  • 74,508
  • 24
  • 191
  • 319
Vlad Yarovyi
  • 709
  • 1
  • 8
  • 16

1 Answers1

0

I have found a way how to solve that issue. The solution was very simple, and I hope it will help for other people too.

editText.setInputType(InputType.TYPE_CLASS_PHONE);
Vlad Yarovyi
  • 709
  • 1
  • 8
  • 16