Most visited

Recently visited

Added in API level 14

SuggestionsInfo

public final class SuggestionsInfo
extends Object implements Parcelable

java.lang.Object
   ↳ android.view.textservice.SuggestionsInfo


该类包含来自文本服务的建议的元数据

Summary

Constants

int RESULT_ATTR_HAS_RECOMMENDED_SUGGESTIONS

可以通过 getSuggestionsAttributes()获得的建议属性的标志:这表明文本服务认为结果建议包括强烈推荐的建议。

int RESULT_ATTR_IN_THE_DICTIONARY

可以通过 getSuggestionsAttributes()获得的建议的属性标志:这表明所请求的单词在文本服务的字典中找到。

int RESULT_ATTR_LOOKS_LIKE_TYPO

可以通过 getSuggestionsAttributes()获得的建议的属性标志:这表明文本服务认为所请求的单词看起来像一个错字。

Inherited constants

From interface android.os.Parcelable

Fields

public static final Creator<SuggestionsInfo> CREATOR

用于使这个类可以分类。

Public constructors

SuggestionsInfo(int suggestionsAttributes, String[] suggestions)

构造函数。

SuggestionsInfo(int suggestionsAttributes, String[] suggestions, int cookie, int sequence)

构造函数。

SuggestionsInfo(Parcel source)

Public methods

int describeContents()

用于使这个类可以分类。

int getCookie()
int getSequence()
String getSuggestionAt(int i)
int getSuggestionsAttributes()
int getSuggestionsCount()
void setCookieAndSequence(int cookie, int sequence)

设置Cookie和从客户端应用程序设置为TextInfo的SuggestionsInfo序列

void writeToParcel(Parcel dest, int flags)

用于将此对象打包成 Parcel

Inherited methods

From class java.lang.Object
From interface android.os.Parcelable

Constants

RESULT_ATTR_HAS_RECOMMENDED_SUGGESTIONS

Added in API level 15
int RESULT_ATTR_HAS_RECOMMENDED_SUGGESTIONS

可以通过 getSuggestionsAttributes()获得的建议属性的标志:这表明文本服务认为结果建议包括强烈推荐的建议。

常量值:4(0x00000004)

RESULT_ATTR_IN_THE_DICTIONARY

Added in API level 14
int RESULT_ATTR_IN_THE_DICTIONARY

可以通过 getSuggestionsAttributes()获得的建议属性的标志:这表明所请求的单词在文本服务的字典中找到。

常数值:1(0x00000001)

RESULT_ATTR_LOOKS_LIKE_TYPO

Added in API level 14
int RESULT_ATTR_LOOKS_LIKE_TYPO

可以通过 getSuggestionsAttributes()获得建议的属性标志:这表明文本服务认为所请求的单词看起来像一个错字。

常量值:2(0x00000002)

Fields

CREATOR

Added in API level 14
Creator<SuggestionsInfo> CREATOR

用于使这个类可以分类。

Public constructors

SuggestionsInfo

Added in API level 14
SuggestionsInfo (int suggestionsAttributes, 
                String[] suggestions)

构造函数。

Parameters
suggestionsAttributes int: from the text service
suggestions String: from the text service

SuggestionsInfo

Added in API level 14
SuggestionsInfo (int suggestionsAttributes, 
                String[] suggestions, 
                int cookie, 
                int sequence)

构造函数。

Parameters
suggestionsAttributes int: from the text service
suggestions String: from the text service
cookie int: the cookie of the input TextInfo
sequence int: the cookie of the input TextInfo

SuggestionsInfo

Added in API level 14
SuggestionsInfo (Parcel source)

Parameters
source Parcel

Public methods

describeContents

Added in API level 14
int describeContents ()

用于使这个类可以分类。

Returns
int a bitmask indicating the set of special object types marshaled by this Parcelable object instance.

getCookie

Added in API level 14
int getCookie ()

Returns
int the cookie which may be set by a client application

getSequence

Added in API level 14
int getSequence ()

Returns
int the sequence which may be set by a client application

getSuggestionAt

Added in API level 14
String getSuggestionAt (int i)

Parameters
i int: the id of suggestions
Returns
String the suggestion at the specified id

getSuggestionsAttributes

Added in API level 14
int getSuggestionsAttributes ()

Returns
int the attributes of suggestions. This includes whether the spell checker has the word in its dictionary or not and whether the spell checker has confident suggestions for the word or not.

getSuggestionsCount

Added in API level 14
int getSuggestionsCount ()

Returns
int the count of the suggestions. If there's no suggestions at all, this method returns -1. Even if this method returns 0, it doesn't necessarily mean that there are no suggestions for the requested word. For instance, the caller could have been asked to limit the maximum number of suggestions returned.

setCookieAndSequence

Added in API level 14
void setCookieAndSequence (int cookie, 
                int sequence)

设置Cookie和从客户端应用程序设置为TextInfo的SuggestionsInfo序列

Parameters
cookie int: the cookie of an input TextInfo
sequence int: the cookie of an input TextInfo

writeToParcel

Added in API level 14
void writeToParcel (Parcel dest, 
                int flags)

用于将此对象打包成 Parcel

Parameters
dest Parcel: The Parcel to be written.
flags int: The flags used for parceling.

Hooray!