Most visited

Recently visited

RemoteInput.Builder

public static final class RemoteInput.Builder
extends Object

java.lang.Object
    android.support.v4.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

RemoteInput.Builder (String resultKey)

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

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

公共方法(Public methods)

addExtras

RemoteInput.Builder addExtras (Bundle extras)

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

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

参数(Parameters)
extras Bundle
返回(Returns)
RemoteInput.Builder

也可以看看:

build

RemoteInput build ()

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

返回(Returns)
RemoteInput

getExtras

Bundle getExtras ()

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

返回的Bundle与此Builder共享。

返回(Returns)
Bundle

setAllowFreeFormInput

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

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

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!