Skip to content

Most visited

Recently visited

navigation

RemoteInput

public final class RemoteInput
extends RemoteInputCompatBase.RemoteInput

java.lang.Object
   ↳ android.support.v4.app.RemoteInputCompatBase.RemoteInput
     ↳ android.support.v4.app.RemoteInput


Helper for using the RemoteInput API introduced after API level 4 in a backwards compatible fashion.

Summary

Nested classes

class RemoteInput.Builder

Builder class for RemoteInput objects. 

Constants

String EXTRA_RESULTS_DATA

Extra added to a clip data intent object to hold the results bundle.

String RESULTS_CLIP_LABEL

Label used to denote the clip data type used for remote input transport

Public methods

static void addResultsToIntent(RemoteInput[] remoteInputs, Intent intent, Bundle results)

Populate an intent object with the results gathered from remote input.

boolean getAllowFreeFormInput()

Get whether or not users can provide an arbitrary value for input.

CharSequence[] getChoices()

Get possible input choices.

Bundle getExtras()

Get additional metadata carried around with this remote input.

CharSequence getLabel()

Get the label to display to users when collecting this input.

String getResultKey()

Get the key that the result of this input will be set in from the Bundle returned by getResultsFromIntent(Intent) when the PendingIntent is sent.

static Bundle getResultsFromIntent(Intent intent)

Get the remote input results bundle from an intent.

Inherited methods

From class android.support.v4.app.RemoteInputCompatBase.RemoteInput
From class java.lang.Object

Constants

EXTRA_RESULTS_DATA

String EXTRA_RESULTS_DATA

Extra added to a clip data intent object to hold the results bundle.

Constant Value: "android.remoteinput.resultsData"

RESULTS_CLIP_LABEL

String RESULTS_CLIP_LABEL

Label used to denote the clip data type used for remote input transport

Constant Value: "android.remoteinput.results"

Public methods

addResultsToIntent

void addResultsToIntent (RemoteInput[] remoteInputs, 
                Intent intent, 
                Bundle results)

Populate an intent object with the results gathered from remote input. This method should only be called by remote input collection services when sending results to a pending intent.

Parameters
remoteInputs RemoteInput: The remote inputs for which results are being provided
intent Intent: The intent to add remote inputs to. The ClipData field of the intent will be modified to contain the results.
results Bundle: A bundle holding the remote input results. This bundle should be populated with keys matching the result keys specified in remoteInputs with values being the result per key.

getAllowFreeFormInput

boolean getAllowFreeFormInput ()

Get whether or not users can provide an arbitrary value for input. If you set this to false, users must select one of the choices in getChoices(). An IllegalArgumentException is thrown if you set this to false and getChoices() returns null or empty.

Returns
boolean

getChoices

CharSequence[] getChoices ()

Get possible input choices. This can be null if there are no choices to present.

Returns
CharSequence[]

getExtras

Bundle getExtras ()

Get additional metadata carried around with this remote input.

Returns
Bundle

getLabel

CharSequence getLabel ()

Get the label to display to users when collecting this input.

Returns
CharSequence

getResultKey

String getResultKey ()

Get the key that the result of this input will be set in from the Bundle returned by getResultsFromIntent(Intent) when the PendingIntent is sent.

Returns
String

getResultsFromIntent

Bundle getResultsFromIntent (Intent intent)

Get the remote input results bundle from an intent. The returned Bundle will contain a key/value for every result key populated by remote input collector. Use the getCharSequence(String) method to retrieve a value.

Parameters
intent Intent: The intent object that fired in response to an action or content intent which also had one or more remote input requested.
Returns
Bundle
This site uses cookies to store your preferences for site-specific language and display options.

Hooray!

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a one-minute survey?
Help us improve Android tools and documentation.