FileDocCategorySizeDatePackage
RemoteInput.javaAPI DocAndroid 5.1 API10010Thu Mar 12 22:22:56 GMT 2015android.support.v4.app

RemoteInput

public class RemoteInput extends RemoteInputCompatBase.RemoteInput
Helper for using the {@link android.app.RemoteInput} API introduced after API level 4 in a backwards compatible fashion.

Fields Summary
private static final String
TAG
public static final String
RESULTS_CLIP_LABEL
Label used to denote the clip data type used for remote input transport
public static final String
EXTRA_RESULTS_DATA
Extra added to a clip data intent object to hold the results bundle.
private final String
mResultKey
private final CharSequence
mLabel
private final CharSequence[]
mChoices
private final boolean
mAllowFreeFormInput
private final android.os.Bundle
mExtras
private static final Impl
IMPL
public static final Factory
FACTORY
Constructors Summary
RemoteInput(String resultKey, CharSequence label, CharSequence[] choices, boolean allowFreeFormInput, android.os.Bundle extras)


         
                
        this.mResultKey = resultKey;
        this.mLabel = label;
        this.mChoices = choices;
        this.mAllowFreeFormInput = allowFreeFormInput;
        this.mExtras = extras;
    
Methods Summary
public static voidaddResultsToIntent(android.support.v4.app.RemoteInput[] remoteInputs, android.content.Intent intent, android.os.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.

param
remoteInputs The remote inputs for which results are being provided
param
intent The intent to add remote inputs to. The {@link android.content.ClipData} field of the intent will be modified to contain the results.
param
results A bundle holding the remote input results. This bundle should be populated with keys matching the result keys specified in {@code remoteInputs} with values being the result per key.

        IMPL.addResultsToIntent(remoteInputs, intent, results);
    
public booleangetAllowFreeFormInput()
Get whether or not users can provide an arbitrary value for input. If you set this to {@code false}, users must select one of the choices in {@link #getChoices}. An {@link IllegalArgumentException} is thrown if you set this to false and {@link #getChoices} returns {@code null} or empty.

        return mAllowFreeFormInput;
    
public java.lang.CharSequence[]getChoices()
Get possible input choices. This can be {@code null} if there are no choices to present.

        return mChoices;
    
public android.os.BundlegetExtras()
Get additional metadata carried around with this remote input.

        return mExtras;
    
public java.lang.CharSequencegetLabel()
Get the label to display to users when collecting this input.

        return mLabel;
    
public java.lang.StringgetResultKey()
Get the key that the result of this input will be set in from the Bundle returned by {@link #getResultsFromIntent} when the {@link android.app.PendingIntent} is sent.

        return mResultKey;
    
public static android.os.BundlegetResultsFromIntent(android.content.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 {@link Bundle#getCharSequence(String)} method to retrieve a value.

param
intent The intent object that fired in response to an action or content intent which also had one or more remote input requested.

        return IMPL.getResultsFromIntent(intent);