Added in API level 14

SpellCheckerService


abstract class SpellCheckerService : Service
kotlin.Any
   ↳ android.content.Context
   ↳ android.content.ContextWrapper
   ↳ android.app.Service
   ↳ android.service.textservice.SpellCheckerService

SpellCheckerService provides an abstract base class for a spell checker. This class combines a service to the system with the spell checker service interface that spell checker must implement.

In addition to the normal Service lifecycle methods, this class introduces a new specific callback that subclasses should override createSession() to provide a spell checker session that is corresponding to requested language and so on. The spell checker session returned by this method should extend SpellCheckerService.Session.

Returning spell check results

SpellCheckerService.Session#onGetSuggestions(TextInfo, int) should return spell check results. It receives android.view.textservice.TextInfo and returns android.view.textservice.SuggestionsInfo for the input. You may want to override SpellCheckerService.Session#onGetSuggestionsMultiple(TextInfo[], int, boolean) for better performance and quality.

Please note that SpellCheckerService.Session#getLocale() does not return a valid locale before SpellCheckerService.Session#onCreate()

Summary

Nested classes
abstract

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

Constants
static String

Inherited constants
Public constructors

Public methods
abstract SpellCheckerService.Session!

Factory method to create a spell checker session impl

IBinder?
onBind(intent: Intent!)

Implement to return the implementation of the internal spell checker service interface.

Inherited functions

Constants

SERVICE_INTERFACE

Added in API level 14
static val SERVICE_INTERFACE: String
Value: "android.service.textservice.SpellCheckerService"

Public constructors

SpellCheckerService

SpellCheckerService()

Public methods

createSession

Added in API level 14
abstract fun createSession(): SpellCheckerService.Session!

Factory method to create a spell checker session impl

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

onBind

Added in API level 14
fun onBind(intent: Intent!): IBinder?

Implement to return the implementation of the internal spell checker service interface. Subclasses should not override.

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