Fixed soft keyboard input flashback.

This commit is contained in:
2023-07-25 00:30:18 +08:00
parent a2c4619842
commit 02eb4aa1ae

View File

@@ -119,7 +119,11 @@ public class MainActivity extends BaseActivityNormal {
imageViewConvert.setEnabled(charSequence.length() != 0);
if (!Pattern.compile(HexConversionUtils.getRegExp(baseFrom)).matcher(charSequence).matches()) {
editTextFrom.setText(beforeText.toString());
editTextFrom.setSelection(beforeText.toString().length() - 1);
try {
editTextFrom.setSelection(beforeText.toString().length() - 1);
} catch (Exception e) {
e.printStackTrace();
}
} else {
textViewTo.setText(null);
}