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


这个抽象类应该被拼写检查器的具体实现覆盖。

摘要(Summary)

Public constructors

SpellCheckerService.Session()

公共方法(Public methods)

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

请求中止在SpellChecker中执行的所有任务。

void onClose()

请求关闭此会话。

abstract void onCreate()

这是在类初始化之后调用的,此时它知道它可以调用getLocale()等等。

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

获取TextInfo数组中指定文本的句子建议。

abstract SuggestionsInfo onGetSuggestions(TextInfo textInfo, int suggestionsLimit)

获取有关TextInfo中指定文本的建议。

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

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 ()

请求中止在SpellChecker中执行的所有任务。 该函数将在传入的IPC线程上运行。 所以,这不会在主线程中调用,但会在另一个线程中串行调用。

onClose

Added in API level 15
void onClose ()

请求关闭此会话。 该函数将在传入的IPC线程上运行。 所以,这不会在主线程中调用,但会在另一个线程中串行调用。

onCreate

Added in API level 14
void onCreate ()

这是在类初始化之后调用的,此时它知道它可以调用getLocale()等等。

onGetSentenceSuggestionsMultiple

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

获取TextInfo数组中指定文本的句子建议。 默认实现将输入文本拆分为单词并返回SentenceSuggestionsInfo ,其中包含每个单词的建议。 该函数将在传入的IPC线程上运行。 所以,这不会在主线程中调用,但会在另一个线程中串行调用。 当您覆盖此方法时,请确保suggestionsLimit应用于共享相同开始位置和长度的建议。

参数(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)

获取有关TextInfo中指定文本的建议。 该函数将在传入的IPC线程上运行。 所以,这不会在主线程中调用,但会在另一个线程中串行调用。

参数(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)

onGetSuggestions的批处理。 该函数将在传入的IPC线程上运行。 所以,这不会在主线程中调用,但会在另一个线程中串行调用。

参数(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!