Android Guides | Samples

Android.App.RemoteInput Class

A RemoteInput object specifies input to be collected from a user to be passed along with an intent inside a PendingIntent that is sent.

See Also: RemoteInput

Syntax

[Android.Runtime.Register("android/app/RemoteInput", DoNotGenerateAcw=true)]
public sealed class RemoteInput : Object, IParcelable, IDisposable

Remarks

A RemoteInput object specifies input to be collected from a user to be passed along with an intent inside a PendingIntent that is sent. Always use NoType:android/app/RemoteInput$Builder;Href=../../../reference/android/app/RemoteInput.Builder.html to create instances of this class.

See Receiving Voice Input from a Notification for more information on how to use this class.

The following example adds a RemoteInput to a NoType:android/app/Notification$Action;Href=../../../reference/android/app/Notification.Action.html, sets the result key as quick_reply, and sets the label as Quick reply. Users are prompted to input a response when they trigger the action. The results are sent along with the intent and can be retrieved with the result key (provided to the NoType:android/app/RemoteInput$Builder;Href=../../../reference/android/app/RemoteInput.Builder.html constructor) from the Bundle returned by RemoteInput.GetResultsFromIntent(Intent).

When the PendingIntent is fired, the intent inside will contain the input results if collected. To access these results, use the RemoteInput.GetResultsFromIntent(Intent) function. The result values will present under the result key passed to the NoType:android/app/RemoteInput$Builder;Href=../../../reference/android/app/RemoteInput.Builder.html constructor.

[Android Documentation]

Requirements

Namespace: Android.App
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0

The members of Android.App.RemoteInput are listed below.

See Also: Object

Public Fields

const
ExtraResultsDataString. Extra added to a clip data intent object to hold the results bundle.
const
ResultsClipLabelString. Label used to denote the clip data type used for remote input transport

Public Properties

[read-only]
AllowFreeFormInputBoolean. Get whether or not users can provide an arbitrary value for input.
[read-only]
static
CreatorIParcelableCreator.
[read-only]
ExtrasBundle. Get additional metadata carried around with this remote input.
[read-only]
LabelString.
[read-only]
LabelFormattedICharSequence. Get the label to display to users when collecting this input.
[read-only]
ResultKeyString. Get the key that the result of this input will be set in from the Bundle returned by RemoteInput.GetResultsFromIntent(Intent) when the PendingIntent is sent.

Protected Properties

[read-only]
override
ThresholdClassIntPtr. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.
[read-only]
override
ThresholdTypeType. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

Public Methods

static
AddResultsToIntent(RemoteInput[], Intent, Bundle)
Populate an intent object with the results gathered from remote input.
DescribeContents() : Int32
Describe the kinds of special objects contained in this Parcelable's marshalled representation.
GetChoices() : String[]
GetChoicesFormatted() : ICharSequence[]
Get possible input choices.
static
GetResultsFromIntent(Intent) : Bundle
Get the remote input results bundle from an intent.
WriteToParcel(Parcel, ParcelableWriteFlags)
Flatten this object in to a Parcel.