mirror of
https://github.com/Helium314/HeliBoard.git
synced 2025-06-28 11:49:56 +00:00
deal with Android refusing to add word to user dictionary
fixes GH-1735
This commit is contained in:
parent
77a728e390
commit
76ebf99921
1 changed files with 4 additions and 1 deletions
|
@ -397,7 +397,10 @@ class DictionaryFacilitatorImpl : DictionaryFacilitator {
|
|||
// This is not too bad, but it delays adding in case a user wants to fill a dictionary using this functionality
|
||||
if (userHistoryDict.getFrequency(word) > 120) {
|
||||
scope.launch {
|
||||
UserDictionary.Words.addWord(userDict.mContext, word, 250, null, dictionaryGroup.locale)
|
||||
// adding can throw IllegalArgumentException: Unknown URL content://user_dictionary/words
|
||||
// https://stackoverflow.com/q/41474623 https://github.com/AnySoftKeyboard/AnySoftKeyboard/issues/490
|
||||
// apparently some devices don't have a dictionary? or it's just sporadic hiccups?
|
||||
runCatching { UserDictionary.Words.addWord(userDict.mContext, word, 250, null, dictionaryGroup.locale) }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue