I use Spell checker framework to display suggestions on my custom Android keyboard. I works fine, but not on Samsung devices. How I can fix this, use another way or may be some library?
My code
val spellCheckerSession =
(context.getSystemService(TEXT_SERVICES_MANAGER_SERVICE) as TextServicesManager)
.newSpellCheckerSession(
null,
Locale.ENGLISH,
object : SpellCheckerSession.SpellCheckerSessionListener {
override fun onGetSuggestions(p0: Array<out SuggestionsInfo>?) {}
override fun onGetSentenceSuggestions(sentenceSuggestionsInfos: Array<out SentenceSuggestionsInfo>?) {
// TODO use suggestions
}
},
true
)
spellCheckerSession?.getSentenceSuggestions(
arrayOf(TextInfo(inputWord)),
SUGGESTION_COUNT
)