Android: Fix if you leave input field with text in it then select it again, you can't backspace the text anymore

This commit is contained in:
UnknownShadow200 2020-10-19 23:32:14 +11:00
parent e93fa93042
commit 53af396dd9

View file

@ -399,8 +399,9 @@ public class MainActivity extends Activity implements SurfaceHolder.Callback2 {
@Override
public Editable getEditable() {
if (!inited) {
// otherwise random crashes later with backspacing
Selection.setSelection(kbText, 0);
// needed to set selection, otherwise random crashes later with backspacing
// set selection to end, so backspacing after opening keyboard with text still works
Selection.setSelection(kbText, kbText.toString().length());
inited = true;
}
return kbText;