在 Android M 中添加到用户词典

Adding to user dictionary in Android M

我想制作一个应用程序,将一堆单词添加到用户词典中。

我知道我可以使用 UserDictionary.Words.AddWords 但是它实际上并没有将单词添加到字典中。

看起来 "WRITE_USER_DICTIONARY" 权限在 M 中被删除了,是否有不同的方法可以将单词添加到用户词典中,或者现在已经完全消失了?

UserDictionary.Words 不能再从 Marshmallow (API 23) 开始访问。

参考:Android Issue Tracker - Issue 199199

The user dictionary is now accessible only by the current spellchecker and keyboard. It was heavily abused by apps to scoop user dictionary. Out of the ten top apps using it there wasn't a single legit one. My favorite was the one which used a bug in keyguard to unlock the device after [it] "scans" [your] fingerprint from the screen! This is intended behavior.