问题描述
我正在尝试在Android平台上编写个人字典应用程序。有标准功能,如添加,编辑,删除。
我将创建一个个人应用程序数据库跟踪单词。
将单词添加到个人字典中;当用户在消息/邮件应用程序中键入时,应该会出现在自动建议中。
我查看了以下代码段,并尝试将其纳入我的应用程序:
UserDictionary.Words.addWord(this,Joglekar,1,Jogl,getResources()。getConfiguration()。locale);
代码执行正常,但在输入时该字词不会显示在自动建议中。
我目前HTC One X正在测试。
如何完成此项任务?
有几个跟进问题,但会等待这个问题解决。 :)
尝试将此添加到您的应用程序的AndroidManifest.xml文件之外< application>
元素:
< uses-permission android:name =android.permission.WRITE_USER_DICTIONARY> ;< /使用的许可>
此解决方案的工作原理类似于以下内容:
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. :)
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
这篇关于Android个人字典应用程序问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!