-->

Android Personal Dictionary App Issues

2019-09-20 00:56发布

问题:

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