Android Intent Copy copyIntentData(Intent aReceived, Intent aDispatch)

Here you can find the source of copyIntentData(Intent aReceived, Intent aDispatch)

Description

Method copies the intent extras from the received intent to the intent that will be dispatched.

Parameter

Parameter Description
aReceived a parameter
aDispatch a parameter

Declaration

public static void copyIntentData(Intent aReceived, Intent aDispatch) 

Method Source Code

//package com.java2s;

import android.content.Intent;

import java.util.Set;

public class Main {
    /**/*ww  w  .ja  v  a2 s . c om*/
     * Method copies the intent extras from the received intent to the intent
     * that will be dispatched.
     *
     * @param aReceived
     * @param aDispatch
     */
    public static void copyIntentData(Intent aReceived, Intent aDispatch) {
        Set<String> lKeys = aReceived.getExtras().keySet();

        for (String lKey : lKeys) {
            aDispatch.putExtra(lKey, aReceived.getStringExtra(lKey));
        }
    }
}