修复Android EditText上拼写错误的单词

时间:2017-05-19 18:40:41

标签: android autocomplete android-edittext

如何在编写软键盘空格键时实现自动修复拼写错误单词的EditText?我在Whatsapp上看到过这种行为,例如,如果你写了#34; aricle"并按空格键,它会放置"文章",如果你写" articl"或类似的东西,是Android行为还是Whatsapp专门行为?我尝试过使用AutoCompleteTextView并设置autoText = true(虽然已弃用,但我必须尝试)

1 个答案:

答案 0 :(得分:0)

自动更正是您使用的键盘功能。但是如果你想在你的Android应用程序中放置这个功能,那么你可以使用anroid提供的拼写检查框架。它允许您在Android服务的帮助下在Android应用程序中实现拼写检查。 有关详细信息,请参阅以下链接

https://developer.android.com/guide/topics/text/spell-checker-framework.html#SpellCheckLifeCycle

例如,您可以查看此链接

https://code.tutsplus.com/tutorials/an-introduction-to-androids-spelling-checker-framework--cms-23754