Most visited

Recently visited

Added in API level 20

RemoteInput.Builder

public static final class RemoteInput.Builder
extends Object

java.lang.Object
   ↳ android.app.RemoteInput.Builder


RemoteInput对象的生成器类。

Summary

Public constructors

RemoteInput.Builder(String resultKey)

RemoteInput对象创建一个构建器对象。

Public methods

RemoteInput.Builder addExtras(Bundle extras)

将其他元数据合并到此构建器中。

RemoteInput build()

组合所有已设置的选项并返回一个新的 RemoteInput对象。

Bundle getExtras()

获取此构建器使用的元数据包。

RemoteInput.Builder setAllowFreeFormInput(boolean allowFreeFormInput)

指定用户是否可以提供任意值。

RemoteInput.Builder setChoices(CharSequence[] choices)

指定用户可用的选项以满足此输入。

RemoteInput.Builder setLabel(CharSequence label)

收集此输入时,设置要显示给用户的标签。

Inherited methods

From class java.lang.Object

Public constructors

RemoteInput.Builder

Added in API level 20
RemoteInput.Builder (String resultKey)

RemoteInput对象创建一个构建器对象。

Parameters
resultKey String: the Bundle key that refers to this input when collected from the user

Public methods

addExtras

Added in API level 20
RemoteInput.Builder addExtras (Bundle extras)

将其他元数据合并到此构建器中。

Bundle中的值将替换此Builder中现有的额外值。

Parameters
extras Bundle
Returns
RemoteInput.Builder

也可以看看:

build

Added in API level 20
RemoteInput build ()

组合所有已设置的选项并返回一个新的 RemoteInput对象。

Returns
RemoteInput

getExtras

Added in API level 20
Bundle getExtras ()

获取此构建器使用的元数据包。

返回的Bundle与此Builder共享。

Returns
Bundle

setAllowFreeFormInput

Added in API level 20
RemoteInput.Builder setAllowFreeFormInput (boolean allowFreeFormInput)

指定用户是否可以提供任意值。

Parameters
allowFreeFormInput boolean: The default is true. If you specify false, you must provide a non-null and non-empty array to setChoices(CharSequence[]) or an IllegalArgumentException is thrown.
Returns
RemoteInput.Builder this object for method chaining

setChoices

Added in API level 20
RemoteInput.Builder setChoices (CharSequence[] choices)

指定用户可用的选项以满足此输入。

Parameters
choices CharSequence: an array of pre-defined choices for users input. You must provide a non-null and non-empty array if you disabled free form input using setAllowFreeFormInput(boolean).
Returns
RemoteInput.Builder this object for method chaining

setLabel

Added in API level 20
RemoteInput.Builder setLabel (CharSequence label)

收集此输入时,设置要显示给用户的标签。

Parameters
label CharSequence: The label to show to users when they input a response.
Returns
RemoteInput.Builder this object for method chaining

Hooray!