belongs to Maven artifact com.android.support:support-compat:28.0.0-alpha1
RemoteInput
public final class RemoteInput
extends Object
java.lang.Object | |
↳ | android.support.v4.app.RemoteInput |
Helper for using the RemoteInput
.
Summary
Nested classes | |
---|---|
class | RemoteInput.Builder Builder class for |
Constants | |
---|---|
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 |
Public methods | |
---|---|
static void | addDataResultToIntent(RemoteInput remoteInput, Intent intent, Map<String, Uri> results) Same as |
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 |
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 text results bundle from an intent. |
boolean | isDataOnly() Returns true if the input only accepts data, meaning |
Inherited methods | |
---|---|
![]() java.lang.Object |
Constants
EXTRA_RESULTS_DATA
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
String RESULTS_CLIP_LABEL
Label used to denote the clip data type used for remote input transport
Constant Value: "android.remoteinput.results"
Public methods
addDataResultToIntent
void addDataResultToIntent (RemoteInput remoteInput, Intent intent, Map<String, Uri> results)
Same as addResultsToIntent(RemoteInput[], Intent, Bundle)
but for setting data results.
Parameters | |
---|---|
remoteInput | RemoteInput : The remote input for which results are being provided |
intent | Intent : The intent to add remote input results to. The ClipData field of the intent will be modified to contain the results. |
results | Map : A map of mime type to the Uri result for that mime type. |
addResultsToIntent
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. |
getAllowFreeFormInput
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 |
getChoices
CharSequence[] getChoices ()
Get possible input choices. This can be null
if there are no choices to present.
Returns | |
---|---|
CharSequence[] |
getDataResultsFromIntent
Map<String, Uri> getDataResultsFromIntent (Intent intent, String remoteInputResultKey)
Similar as getResultsFromIntent(Intent)
but retrieves data results for a specific RemoteInput result. To retrieve a value use:
Map<String, Uri> results = RemoteInput.getDataResultsFromIntent(intent, REMOTE_INPUT_KEY); if (results != null) { Uri data = results.get(MIME_TYPE_OF_INTEREST); }
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. |
remoteInputResultKey | String : The result key for the RemoteInput you want results for. |
Returns | |
---|---|
Map<String, Uri> |
getExtras
Bundle getExtras ()
Get additional metadata carried around with this remote input.
Returns | |
---|---|
Bundle |
getLabel
CharSequence getLabel ()
Get the label to display to users when collecting this input.
Returns | |
---|---|
CharSequence |
getResultKey
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 |
getResultsFromIntent
Bundle getResultsFromIntent (Intent intent)
Get the remote input text 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. For data results use getDataResultsFromIntent(Intent, String)
.
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 |
isDataOnly
boolean isDataOnly ()
Returns true if the input only accepts data, meaning getAllowFreeFormInput()
is false, getChoices()
is null or empty, and {@link #getAllowedDataTypes is non-null and not empty.
Returns | |
---|---|
boolean |
Annotations
Interfaces
- ActionBarDrawerToggle.Delegate
- ActionBarDrawerToggle.DelegateProvider
- ActivityCompat.OnRequestPermissionsResultCallback
- ActivityCompat.PermissionCompatDelegate
- FragmentManager.BackStackEntry
- FragmentManager.OnBackStackChangedListener
- LoaderManager.LoaderCallbacks
- NotificationCompat.Action.Extender
- NotificationCompat.Extender
- SharedElementCallback.OnSharedElementsReadyListener
- TaskStackBuilder.SupportParentable
Classes
- ActionBarDrawerToggle
- ActivityCompat
- ActivityManagerCompat
- ActivityOptionsCompat
- AlarmManagerCompat
- AppLaunchChecker
- AppOpsManagerCompat
- BundleCompat
- DialogFragment
- Fragment
- Fragment.SavedState
- FragmentActivity
- FragmentContainer
- FragmentController
- FragmentHostCallback
- FragmentManager
- FragmentManager.FragmentLifecycleCallbacks
- FragmentManagerNonConfig
- FragmentPagerAdapter
- FragmentStatePagerAdapter
- FragmentTabHost
- FragmentTransaction
- FrameMetricsAggregator
- JobIntentService
- ListFragment
- LoaderManager
- NavUtils
- NotificationCompat
- NotificationCompat.Action
- NotificationCompat.Action.Builder
- NotificationCompat.Action.WearableExtender
- NotificationCompat.BigPictureStyle
- NotificationCompat.BigTextStyle
- NotificationCompat.Builder
- NotificationCompat.CarExtender
- NotificationCompat.CarExtender.UnreadConversation
- NotificationCompat.CarExtender.UnreadConversation.Builder
- NotificationCompat.DecoratedCustomViewStyle
- NotificationCompat.InboxStyle
- NotificationCompat.MessagingStyle
- NotificationCompat.MessagingStyle.Message
- NotificationCompat.Style
- NotificationCompat.WearableExtender
- NotificationCompatExtras
- NotificationCompatSideChannelService
- NotificationManagerCompat
- RemoteInput
- RemoteInput.Builder
- ServiceCompat
- ShareCompat
- ShareCompat.IntentBuilder
- ShareCompat.IntentReader
- SharedElementCallback
- TaskStackBuilder
Exceptions
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.