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.
Nested classes | |
|---|---|
class |
RemoteInput.Builder
Builder class for |
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
|
static
Bundle
|
getResultsFromIntent(Intent intent)
Get the remote input results bundle from an intent. |
Inherited methods | |
|---|---|
android.support.v4.app.RemoteInputCompatBase.RemoteInput
| |
java.lang.Object
| |
String EXTRA_RESULTS_DATA
Extra added to a clip data intent object to hold the results bundle.
Constant Value: "android.remoteinput.resultsData"
String RESULTS_CLIP_LABEL
Label used to denote the clip data type used for remote input transport
Constant Value: "android.remoteinput.results"
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.
|
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 |
|
CharSequence[] getChoices ()
Get possible input choices. This can be null if there are no choices to present.
| Returns | |
|---|---|
CharSequence[] |
|
Bundle getExtras ()
Get additional metadata carried around with this remote input.
| Returns | |
|---|---|
Bundle |
|
CharSequence getLabel ()
Get the label to display to users when collecting this input.
| Returns | |
|---|---|
CharSequence |
|
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 |
|
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 |
|