Most visited

Recently visited

Added in API level 14

SpellCheckerService.Session

public static abstract class SpellCheckerService.Session
extends Object

java.lang.Object
   ↳ android.service.textservice.SpellCheckerService.Session


This abstract class should be overridden by a concrete implementation of a spell checker.

Summary

Public constructors

SpellCheckerService.Session()

Public methods

Bundle getBundle()
String getLocale()
void onCancel()

Request to abort all tasks executed in SpellChecker.

void onClose()

Request to close this session.

abstract void onCreate()

This is called after the class is initialized, at which point it knows it can call getLocale() etc...

SentenceSuggestionsInfo[] onGetSentenceSuggestionsMultiple(TextInfo[] textInfos, int suggestionsLimit)

Get sentence suggestions for specified texts in an array of TextInfo.

abstract SuggestionsInfo onGetSuggestions(TextInfo textInfo, int suggestionsLimit)

Get suggestions for specified text in TextInfo.

SuggestionsInfo[] onGetSuggestionsMultiple(TextInfo[] textInfos, int suggestionsLimit, boolean sequentialWords)

A batch process of onGetSuggestions.

Inherited methods

From class java.lang.Object

Public constructors

SpellCheckerService.Session

Added in API level 14
SpellCheckerService.Session ()

Public methods

getBundle

Added in API level 14
Bundle getBundle ()

Returns
Bundle Bundle for this session

getLocale

Added in API level 14
String getLocale ()

Returns
String Locale for this session

onCancel

Added in API level 14
void onCancel ()

Request to abort all tasks executed in SpellChecker. This function will run on the incoming IPC thread. So, this is not called on the main thread, but will be called in series on another thread.

onClose

Added in API level 15
void onClose ()

Request to close this session. This function will run on the incoming IPC thread. So, this is not called on the main thread, but will be called in series on another thread.

onCreate

Added in API level 14
void onCreate ()

This is called after the class is initialized, at which point it knows it can call getLocale() etc...

onGetSentenceSuggestionsMultiple

Added in API level 16
SentenceSuggestionsInfo[] onGetSentenceSuggestionsMultiple (TextInfo[] textInfos, 
                int suggestionsLimit)

Get sentence suggestions for specified texts in an array of TextInfo. The default implementation splits the input text to words and returns SentenceSuggestionsInfo which contains suggestions for each word. This function will run on the incoming IPC thread. So, this is not called on the main thread, but will be called in series on another thread. When you override this method, make sure that suggestionsLimit is applied to suggestions that share the same start position and length.

Parameters
textInfos TextInfo: an array of the text metadata
suggestionsLimit int: the maximum number of suggestions to be returned
Returns
SentenceSuggestionsInfo[] an array of SentenceSuggestionsInfo returned by onGetSuggestions(TextInfo, int)

onGetSuggestions

Added in API level 14
SuggestionsInfo onGetSuggestions (TextInfo textInfo, 
                int suggestionsLimit)

Get suggestions for specified text in TextInfo. This function will run on the incoming IPC thread. So, this is not called on the main thread, but will be called in series on another thread.

Parameters
textInfo TextInfo: the text metadata
suggestionsLimit int: the maximum number of suggestions to be returned
Returns
SuggestionsInfo SuggestionsInfo which contains suggestions for textInfo

onGetSuggestionsMultiple

Added in API level 14
SuggestionsInfo[] onGetSuggestionsMultiple (TextInfo[] textInfos, 
                int suggestionsLimit, 
                boolean sequentialWords)

A batch process of onGetSuggestions. This function will run on the incoming IPC thread. So, this is not called on the main thread, but will be called in series on another thread.

Parameters
textInfos TextInfo: an array of the text metadata
suggestionsLimit int: the maximum number of suggestions to be returned
sequentialWords boolean: true if textInfos can be treated as sequential words.
Returns
SuggestionsInfo[] an array of SentenceSuggestionsInfo returned by onGetSuggestions(TextInfo, int)

Hooray!