Radovan
Radovan

Reputation: 142

Adding a word into a custom Dictionary from a SpellCheckerService

I am implementing an IME with a customized dictionary and Id like to create a SpellCheckerService as well. The integration is trivial however I cannot seem to find any documentation on how to add non existant words to my dictionary. The button is there, but upon click it sends me to the devices custom words list which I do not want to do. I want to add the word into my structures. I dont see any overridable methods that would do this in SpellCheckerService nor the Session class.

Is there any way to achieve this?

EDIT: added a picture of what I want to override for clarification

enter image description here

Upvotes: 2

Views: 553

Answers (1)

Radovan
Radovan

Reputation: 142

Well I found it out.

The word editor activity has to have this in the manifest:

<intent-filter>
   <action android:name="com.android.settings.USER_DICTIONARY_INSERT" />
   <action android:name="com.android.settings.USER_DICTIONARY_EDIT" />
   <category android:name="android.intent.category.DEFAULT" />
   <category android:name="android.intent.category.VOICE_LAUNCH" />
</intent-filter>

Source: The Android app source code

Upvotes: 2

Related Questions