compat/src/main/java/androidx/core/app/RemoteInput.java
public static void addDataResultToIntent(RemoteInput remoteInput, Intent intent,
            Map<String, Uri> results) {
        if (Build.VERSION.SDK_INT >= 26) {
            android.app.RemoteInput.addDataResultToIntent(fromCompat(remoteInput), intent, results);
        } else if (Build.VERSION.SDK_INT >= 16) {
            Intent clipDataIntent = getClipDataIntentFromIntent(intent);
            if (clipDataIntent == null) {
                clipDataIntent = new Intent();  // First time we've added a result.
            }
            for (Map.Entry<String, Uri> entry : results.entrySet()) {
                String mimeType = entry.getKey();
                Uri uri = entry.getValue();
                if (mimeType == null) {
                    continue;
                }
                Bundle resultsBundle =
                        clipDataIntent.getBundleExtra(getExtraResultsKeyForData(mimeType));
                if (resultsBundle == null) {
                    resultsBundle = new Bundle();
                }
                resultsBundle.putString(remoteInput.getResultKey(), uri.toString());
                clipDataIntent.putExtra(getExtraResultsKeyForData(mimeType), resultsBundle);
            }
            intent.setClipData(ClipData.newIntent(RemoteInput.RESULTS_CLIP_LABEL, clipDataIntent));
        } else {
            Log.w(TAG, "RemoteInput is only supported from API Level 16");
        }
    }
/**
     * Same as {@link #addResultsToIntent} but for setting data results.
     * @param remoteInput The remote input for which results are being provided
     * @param intent The intent to add remote input results to. The
     *               {@link android.content.ClipData} field of the intent will be
     *               modified to contain the results.
     * @param results A map of mime type to the Uri result for that mime type.
     */
Same as  #addResultsToIntent but for setting data results.
@param remoteInput The remote input for which results are being provided
@param intent The intent to add remote input results to. The
android.content.ClipData field of the intent will be
modified to contain the results.
@param results A map of mime type to the Uri result for that mime type.
Same as #addResultsToIntent but for setting data results . @param remoteInput The remote input for which results are being provided @param intent The intent to add remote input results to . The android . content . ClipData field of the intent will be modified to contain the results . @param results A map of mime type to the Uri result for that mime type .
public static void addDataResultToIntent(RemoteInput remoteInput, Intent intent,
            Map<String, Uri> results) {
        if (Build.VERSION.SDK_INT >= 26) {
            android.app.RemoteInput.addDataResultToIntent(fromCompat(remoteInput), intent, results);
        } else if (Build.VERSION.SDK_INT >= 16) {
            Intent clipDataIntent = getClipDataIntentFromIntent(intent);
            if (clipDataIntent == null) {
                clipDataIntent = new Intent();  
            }
            for (Map.Entry<String, Uri> entry : results.entrySet()) {
                String mimeType = entry.getKey();
                Uri uri = entry.getValue();
                if (mimeType == null) {
                    continue;
                }
                Bundle resultsBundle =
                        clipDataIntent.getBundleExtra(getExtraResultsKeyForData(mimeType));
                if (resultsBundle == null) {
                    resultsBundle = new Bundle();
                }
                resultsBundle.putString(remoteInput.getResultKey(), uri.toString());
                clipDataIntent.putExtra(getExtraResultsKeyForData(mimeType), resultsBundle);
            }
            intent.setClipData(ClipData.newIntent(RemoteInput.RESULTS_CLIP_LABEL, clipDataIntent));
        } else {
            Log.w(TAG, "RemoteInput is only supported from API Level 16");
        }
    }
public static void addDataResultToIntent ( RemoteInput remoteInput , Intent intent , Map < String , Uri > results ) { if ( Build . VERSION . SDK_INT >= 26 ) { android . app . RemoteInput . addDataResultToIntent ( fromCompat ( remoteInput ) , intent , results ) ; } else if ( Build . VERSION . SDK_INT >= 16 ) { Intent clipDataIntent = getClipDataIntentFromIntent ( intent ) ; if ( clipDataIntent == null ) { clipDataIntent = new Intent ( ) ; } for ( Map . Entry < String , Uri > entry : results . entrySet ( ) ) { String mimeType = entry . getKey ( ) ; Uri uri = entry . getValue ( ) ; if ( mimeType == null ) { continue ; } Bundle resultsBundle = clipDataIntent . getBundleExtra ( getExtraResultsKeyForData ( mimeType ) ) ; if ( resultsBundle == null ) { resultsBundle = new Bundle ( ) ; } resultsBundle . putString ( remoteInput . getResultKey ( ) , uri . toString ( ) ) ; clipDataIntent . putExtra ( getExtraResultsKeyForData ( mimeType ) , resultsBundle ) ; } intent . setClipData ( ClipData . newIntent ( RemoteInput . RESULTS_CLIP_LABEL , clipDataIntent ) ) ; } else { Log . w ( TAG , "RemoteInput is only supported from API Level 16" ) ; } }
Same as {@link #addResultsToIntent} but for setting data results.
Same as { @link #addResultsToIntent } but for setting data results .
// First time we've added a result.