Issue Programmatically Adding Word for Word Prediction

自作多情 提交于 2020-03-14 07:33:28

问题


I am using UserDictionary.Words class's addWord function to add Words to Dictionary so that they can show up in Text prediction. The Words do exist in the dictionary with APP_ID=0 and available for default android keyboard. However I am using Swift keyboard and it is not considering those words for Prediction.

I am using this TUTORIAL

 UserDictionary.Words.addWord(this, "ThisIsSomeWordIwantForPrediction", 250, null, Locale.getDefault());

My question is how can I add words such that they are available for prediction for all keyboards


回答1:


You are doing the right thing to make the words available, but as you have found, not all keyboards are reading from the system dictionary content provider.

That's a question you need to address to Swiftkey, as to why their keyboard does not use the system provided word list.

(Similarly, not all web browser apps make use of the system provided bookmark storage, and messaging apps like whatsapp provide their own storage solution, rather than making use of the inbuilt SMS storage provider).



来源:https://stackoverflow.com/questions/31660006/issue-programmatically-adding-word-for-word-prediction

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!