RemoteInput

public final class RemoteInput
extends Object

java.lang.Object
   ↳ androidx.core.app.RemoteInput


Helper for using the RemoteInput.

Summary

Nested classes

class RemoteInput.Builder

Builder class for RemoteInput objects. 

Constants

int EDIT_CHOICES_BEFORE_SENDING_AUTO

The platform will determine whether choices will be edited before being sent to the app.

int EDIT_CHOICES_BEFORE_SENDING_DISABLED

Tapping on a choice should send the input immediately, without letting the user edit it.

int EDIT_CHOICES_BEFORE_SENDING_ENABLED

Tapping on a choice should let the user edit the input before it is sent to the app.

String EXTRA_RESULTS_DATA

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

String RESULTS_CLIP_LABEL

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

int SOURCE_CHOICE

The user selected one of the choices from getChoices().

int SOURCE_FREE_FORM_INPUT

The user manually entered the data.

Public methods

static void addDataResultToIntent(RemoteInput remoteInput, Intent intent, Map<String, Uri> results)

Same as addResultsToIntent(RemoteInput[], Intent, Bundle) but for setting data results.

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.

Set<String> getAllowedDataTypes()
CharSequence[] getChoices()

Get possible input choices.

static Map<String, Uri> getDataResultsFromIntent(Intent intent, String remoteInputResultKey)

Similar as getResultsFromIntent(Intent) but retrieves data results for a specific RemoteInput result.

int getEditChoicesBeforeSending()

Gets whether tapping on a choice should let the user edit the input before it is sent to the app.

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 text results bundle from an intent.

static int getResultsSource(Intent intent)

Get the source of the RemoteInput results.

boolean isDataOnly()

Returns true if the input only accepts data, meaning getAllowFreeFormInput() is false, getChoices() is null or empty, and getAllowedDataTypes() is non-null and not empty.

static void setResultsSource(Intent intent, int source)

Set the source of the RemoteInput results.

Inherited methods

Constants

EDIT_CHOICES_BEFORE_SENDING_AUTO

public static final int EDIT_CHOICES_BEFORE_SENDING_AUTO

The platform will determine whether choices will be edited before being sent to the app.

Constant Value: 0 (0x00000000)

EDIT_CHOICES_BEFORE_SENDING_DISABLED

public static final int EDIT_CHOICES_BEFORE_SENDING_DISABLED

Tapping on a choice should send the input immediately, without letting the user edit it.

Constant Value: 1 (0x00000001)

EDIT_CHOICES_BEFORE_SENDING_ENABLED

public static final int EDIT_CHOICES_BEFORE_SENDING_ENABLED

Tapping on a choice should let the user edit the input before it is sent to the app.

Constant Value: 2 (0x00000002)

EXTRA_RESULTS_DATA

public static final String EXTRA_RESULTS_DATA

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

Constant Value: "android.remoteinput.resultsData"

RESULTS_CLIP_LABEL

public static final String RESULTS_CLIP_LABEL

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

Constant Value: "android.remoteinput.results"

SOURCE_CHOICE

public static final int SOURCE_CHOIC