Android Personal Dictionary App Issues

别来无恙 提交于 2020-01-07 08:49:42

问题


I am trying to write a personal dictionary application on android platform.
There are standard features like add,edit,delete.
I will be creating a personal application database to keep track of words.
Once the word is added in the personal dictionary; it should appear in the auto suggest when user is typing it in messaging/mail apps.
I looked at the following code snippet and tried to incorporate in my app:

UserDictionary.Words.addWord(this, "Joglekar", 1, "Jogl", getResources().getConfiguration().locale);

The code executes fine but the word does not appear in the auto suggest while typing.
I am testing on HTC One X as of now.
Any leads on how to accomplish this ??
Have a few follow up questions but will wait for this one to resolve. :)


回答1:


Try adding this to your app's AndroidManifest.xml file outside of the <application> element:

<uses-permission android:name="android.permission.WRITE_USER_DICTIONARY"></uses-permission>

This solution worked at a similar problem, found here: Add Words to Android's UserDictionary



来源:https://stackoverflow.com/questions/22124711/android-personal-dictionary-app-issues

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