An example of how EditText shields the expression of a third-party input method in Android
preface
As we all know, if the expression of the third-party input method is used, it will bring some trouble to the development. Generally, the characters uploaded by the server are ordinary characters, but the test is to take out the Sogou input method and point out a few expressions. Then the problem comes, either showing an exception or directly crashing, but few models will support it, Maybe the third-party ROM has done some processing on Android textview, so we can only kill the damn expression.
The specific methods are as follows:
First, add textwatcher in edittextview
When judging the change of characters, judge the type of characters and whether they are characters. Otherwise, delete the original characters and re-enter them;
Here is to judge whether the character is an expression;
summary
The above is all about the content of EditText shielding the expression of third-party input method in Android. I hope the content of this article can bring some help to your study or work. If you have any questions, you can leave a message for communication.