Most visited

Recently visited

Added in API level 14

SpellCheckerService

public abstract class SpellCheckerService
extends Service

java.lang.Object
   ↳ android.content.Context
     ↳ android.content.ContextWrapper
       ↳ android.app.Service
         ↳ android.service.textservice.SpellCheckerService


SpellCheckerService为拼写检查器提供抽象基类。 此类将拼写检查器必须实现的拼写检查器服务界面与系统服务组合在一起。

除了正常的服务生命周期方法之外,此类还引入了一个新的特定回调,即子类应覆盖createSession()以提供与请求的语言对应的拼写检查器会话等。 此方法返回的拼写检查器会话应该延长SpellCheckerService.Session

Returning spell check results

onGetSuggestions(TextInfo, int)应该返回拼写检查结果。 它收到TextInfo并返回SuggestionsInfo作为输入。 您可能想覆盖onGetSuggestionsMultiple(TextInfo[], int, boolean)以获得更好的性能和质量。

请注意, getLocale()onCreate()之前没有返回有效的区域设置

Summary

Nested classes

class SpellCheckerService.Session

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

Constants

String SERVICE_INTERFACE

Inherited constants

From class android.app.Service
From class android.content.Context
From interface android.content.ComponentCallbacks2

Public constructors

SpellCheckerService()

Public methods

abstract SpellCheckerService.Session createSession()

工厂方法创建一个拼写检查器会话impl

final IBinder onBind(Intent intent)

实现返回内部拼写检查器服务接口的实现。

Inherited methods

From class android.app.Service
From class android.content.ContextWrapper
From class android.content.Context
From class java.lang.Object
From interface android.content.ComponentCallbacks2
From interface android.content.ComponentCallbacks

Constants

SERVICE_INTERFACE

Added in API level 14
String SERVICE_INTERFACE

常量值:“android.service.textservice.SpellCheckerService”

Public constructors

SpellCheckerService

Added in API level 14
SpellCheckerService ()

Public methods

createSession

Added in API level 14
SpellCheckerService.Session createSession ()

工厂方法创建一个拼写检查器会话impl

Returns
SpellCheckerService.Session SpellCheckerSessionImpl which should be overridden by a concrete implementation.

onBind

Added in API level 14
IBinder onBind (Intent intent)

实现返回内部拼写检查器服务接口的实现。 子类不应该重写。

Parameters
intent Intent: The Intent that was used to bind to this service, as given to Context.bindService. Note that any extras that were included with the Intent at that point will not be seen here.
Returns
IBinder Return an IBinder through which clients can call on to the service.

Hooray!