Skip to content

Commit

Permalink
Merge pull request tidev#7905 from m1ga/master
Browse files Browse the repository at this point in the history
[TIMOB-19639] Android: IME setSelection fix
  • Loading branch information
hansemannn committed Apr 22, 2016
2 parents 077ca4c + 291e175 commit c291682
Showing 1 changed file with 7 additions and 0 deletions.
Expand Up @@ -617,6 +617,13 @@ public void setSelection(int start, int end)
Log.w(TAG, "Invalid range for text selection. Ignoring.");
return;
}

// http://stackoverflow.com/a/35527348/1504248
Editable text = tv.getText();
if (text.length() > 0) {
text.replace(0, 1, text.subSequence(0, 1), 0, 1);
}

tv.setSelection(start, end);
}

Expand Down

0 comments on commit c291682

Please sign in to comment.