Compartilhar via


SpellCheckerSession Class

Definition

The SpellCheckerSession interface provides the per client functionality of SpellCheckerService.

[Android.Runtime.Register("android/view/textservice/SpellCheckerSession", DoNotGenerateAcw=true)]
public class SpellCheckerSession : Java.Lang.Object
[<Android.Runtime.Register("android/view/textservice/SpellCheckerSession", DoNotGenerateAcw=true)>]
type SpellCheckerSession = class
    inherit Object
Inheritance
SpellCheckerSession
Attributes

Remarks

The SpellCheckerSession interface provides the per client functionality of SpellCheckerService.

"Applications"><h3>Applications</h3>

In most cases, applications that are using the standard android.widget.TextView or its subclasses will have little they need to do to work well with spell checker services. The main things you need to be aware of are:

<ul> <li> Properly set the android.R.attr#inputType in your editable text views, so that the spell checker will have enough context to help the user in editing text in them. </ul>

For the rare people amongst us writing client applications that use the spell checker service directly, you will need to use #getSuggestions(TextInfo, int) or #getSuggestions(TextInfo[], int, boolean) for obtaining results from the spell checker service by yourself.

<h3>Security</h3>

There are a lot of security issues associated with spell checkers, since they could monitor all the text being sent to them through, for instance, android.widget.TextView. The Android spell checker framework also allows arbitrary third party spell checkers, so care must be taken to restrict their selection and interactions.

Here are some key points about the security architecture behind the spell checker framework:

<ul> <li>Only the system is allowed to directly access a spell checker framework's android.service.textservice.SpellCheckerService interface, via the android.Manifest.permission#BIND_TEXT_SERVICE permission. This is enforced in the system by not binding to a spell checker service that does not require this permission.

<li>The user must explicitly enable a new spell checker in settings before they can be enabled, to confirm with the system that they know about it and want to make it available for use. </ul>

Java documentation for android.view.textservice.SpellCheckerSession.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Constructors

SpellCheckerSession(IntPtr, JniHandleOwnership)

A constructor used when creating managed representations of JNI objects; called by the runtime.

Fields

ServiceMetaData

Name under which a SpellChecker service component publishes information about itself.

Properties

Class

Returns the runtime class of this Object.

(Inherited from Object)
Handle

The handle to the underlying Android instance.

(Inherited from Object)
IsSessionDisconnected
JniIdentityHashCode (Inherited from Object)
JniPeerMembers
PeerReference (Inherited from Object)
SpellChecker

Get the spell checker service info this spell checker session has.

ThresholdClass

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

ThresholdType

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

Methods

Cancel()

Cancel pending and running spell check tasks

Clone()

Creates and returns a copy of this object.

(Inherited from Object)
Close()

Finish this session and allow TextServicesManagerService to disconnect the bound spell checker.

Dispose() (Inherited from Object)
Dispose(Boolean) (Inherited from Object)
Equals(Object)

Indicates whether some other object is "equal to" this one.

(Inherited from Object)
GetHashCode()

Returns a hash code value for the object.

(Inherited from Object)
GetSentenceSuggestions(TextInfo[], Int32)

Get suggestions from the specified sentences

GetSuggestions(TextInfo, Int32)
Obsolete.

Get candidate strings for a substring of the specified text.

GetSuggestions(TextInfo[], Int32, Boolean)
Obsolete.

A batch process of getSuggestions

JavaFinalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

(Inherited from Object)
Notify()

Wakes up a single thread that is waiting on this object's monitor.

(Inherited from Object)
NotifyAll()

Wakes up all threads that are waiting on this object's monitor.

(Inherited from Object)
SetHandle(IntPtr, JniHandleOwnership)

Sets the Handle property.

(Inherited from Object)
ToArray<T>() (Inherited from Object)
ToString()

Returns a string representation of the object.

(Inherited from Object)
UnregisterFromRuntime() (Inherited from Object)
Wait()

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>.

(Inherited from Object)
Wait(Int64, Int32)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)
Wait(Int64)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)

Explicit Interface Implementations

IJavaPeerable.Disposed() (Inherited from Object)
IJavaPeerable.DisposeUnlessReferenced() (Inherited from Object)
IJavaPeerable.Finalized() (Inherited from Object)
IJavaPeerable.JniManagedPeerState (Inherited from Object)
IJavaPeerable.SetJniIdentityHashCode(Int32) (Inherited from Object)
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) (Inherited from Object)
IJavaPeerable.SetPeerReference(JniObjectReference) (Inherited from Object)

Extension Methods

JavaCast<TResult>(IJavaObject)

Performs an Android runtime-checked type conversion.

JavaCast<TResult>(IJavaObject)
GetJniTypeName(IJavaPeerable)

Applies to