-2

I am usuing edit field, but when I type any text in this field, then cursor in not moving with the text, It is showing typed text, but cursor position still remains on start .

I am using Os 6 and Os 7/7.1.

Please let me know for the problem. Following is the image for it.

enter image description here

Community
  • 1
  • 1
AnkitRox
  • 494
  • 1
  • 6
  • 16

1 Answers1

0

I have added following code - onFocus and onUnFocus methods to the text field:

protected void onFocus(int direction) {
    this.setCursorPosition(this.getTextLength());
    invalidate();
    super.onFocus(direction);
};

protected void onUnfocus() {
    this.setCursorPosition(this.getTextLength());
    invalidate();
    super.onUnfocus();
};

It has solved my problem. Thanks to all for your support.

AnkitRox
  • 494
  • 1
  • 6
  • 16