public final class RemoteInput extends RemoteInputCompatBase.RemoteInput
RemoteInput
API
introduced after API level 4 in a backwards compatible fashion.Modifier and Type | Class and Description |
---|---|
static class |
RemoteInput.Builder
Builder class for
RemoteInput objects. |
RemoteInputCompatBase.RemoteInput.Factory
Modifier and Type | Field and Description |
---|---|
static String |
EXTRA_RESULTS_DATA
Extra added to a clip data intent object to hold the results bundle.
|
static RemoteInputCompatBase.RemoteInput.Factory |
FACTORY |
static String |
RESULTS_CLIP_LABEL
Label used to denote the clip data type used for remote input transport
|
Modifier and Type | Method and Description |
---|---|
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(android.content.Intent) when the PendingIntent is sent. |
static Bundle |
getResultsFromIntent(Intent intent)
Get the remote input results bundle from an intent.
|
public static final String RESULTS_CLIP_LABEL
public static final String EXTRA_RESULTS_DATA
public static final RemoteInputCompatBase.RemoteInput.Factory FACTORY
public String getResultKey()
getResultsFromIntent(android.content.Intent)
when the PendingIntent
is sent.getResultKey
in class RemoteInputCompatBase.RemoteInput
public CharSequence getLabel()
getLabel
in class RemoteInputCompatBase.RemoteInput
public CharSequence[] getChoices()
null
if there are no choices to present.getChoices
in class RemoteInputCompatBase.RemoteInput
public boolean getAllowFreeFormInput()
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.getAllowFreeFormInput
in class RemoteInputCompatBase.RemoteInput
public Bundle getExtras()
getExtras
in class RemoteInputCompatBase.RemoteInput
public static Bundle getResultsFromIntent(Intent intent)
Bundle.getCharSequence(String)
method to retrieve a value.intent
- The intent object that fired in response to an action or content intent
which also had one or more remote input requested.public static void addResultsToIntent(RemoteInput[] remoteInputs, Intent intent, Bundle results)
remoteInputs
- The remote inputs for which results are being providedintent
- The intent to add remote inputs to. The ClipData
field of the intent will be modified to contain the results.results
- 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.