Note: The Wearable Support Library classes under the android.support.wearable
package are subject to change. For the full Android API reference, see Reference.
java.lang.Object | |
↳ | android.support.wearable.input.RemoteInputIntent |
Constants for supporting remote inputs through starting an Intent
.
The following example prompts the user to provide input for one RemoteInput
by
starting an input activity.
public static final String KEY_QUICK_REPLY_TEXT = "quick_reply"; RemoteInput[] remoteInputs = new RemoteInput[] { new RemoteInput.Builder(KEY_QUICK_REPLY_TEXT).setLabel("Quick reply").build() }; Intent intent = new Intent(ACTION_REMOTE_INPUT); intent.putExtra(EXTRA_REMOTE_INPUT, remoteInputs); startActivity(intent);
The intent returned via onActivityResult(int, int, Intent)
will contain the input results
if collected. To access these results, use the getResultsFromIntent(Intent)
function. The result values will present under the result key passed to the RemoteInput.Builder
constructor.
public static final String KEY_QUICK_REPLY_TEXT = "quick_reply"; Bundle results = RemoteInput.getResultsFromIntent(intent); if (results != null) { CharSequence quickReplyResult = results.getCharSequence(KEY_QUICK_REPLY_TEXT); }
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
String | ACTION_REMOTE_INPUT |
Starts an activity that will prompt the user for inputs based on the
RemoteInput .
|
|||||||||
String | EXTRA_CANCEL_LABEL | Optional string to display to cancel the action. | |||||||||
String | EXTRA_CONFIRM_LABEL | Optional string to display to confirm that the action should be executed. | |||||||||
String | EXTRA_IN_PROGRESS_LABEL | Optional string to display while the wearable is preparing to automatically execute the action. | |||||||||
String | EXTRA_REMOTE_INPUTS |
Array of RemoteInput , to be used with ACTION_REMOTE_INPUT , to specify
inputs to be collected from a user.
|
|||||||||
String | EXTRA_SKIP_CONFIRMATION_UI |
Optional boolean, to be used with ACTION_REMOTE_INPUT , to indicate if a
confirmation screen should be displayed to the user after he entered its input.
|
|||||||||
String | EXTRA_TITLE | String to display on top of the confirmation screen to describe the action like "SMS" or "Email". |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Starts an activity that will prompt the user for inputs based on the
RemoteInput
. The results will be returned via activity results (in
onActivityResult(int, int, Intent)
. To retrieve the user's inputs,
getResultsFromIntent(Intent)
should be called to get a bundle containing a
key/value for every result key populated by remote input collector.
When using this action, the extra EXTRA_REMOTE_INPUTS
should be populated with
an array of RemoteInput
.
Optional string to display to cancel the action. This is usually an imperative verb, like "Cancel". Defaults to Cancel.
Optional string to display to confirm that the action should be executed. This is usually an imperative verb like "Send". Defaults to "Send".
Optional string to display while the wearable is preparing to automatically execute the action. This is usually a 'ing' verb ending in ellipsis like "Sending...". Defaults to "Sending...".
Array of RemoteInput
, to be used with ACTION_REMOTE_INPUT
, to specify
inputs to be collected from a user.
Optional boolean, to be used with ACTION_REMOTE_INPUT
, to indicate if a
confirmation screen should be displayed to the user after he entered its input.
The defaults is true, meaning that a confirmation screen will be displayed to the user
before results are returned via activity results.
String to display on top of the confirmation screen to describe the action like "SMS" or "Email".