Example usage for android.os Bundle putAll

List of usage examples for android.os Bundle putAll

Introduction

In this page you can find the example usage for android.os Bundle putAll.

Prototype

public void putAll(Bundle bundle) 

Source Link

Document

Inserts all mappings from the given Bundle into this Bundle.

Usage

From source file:Main.java

public static void transferData(Bundle oldBundle, Bundle newBundle) {
    if (oldBundle != null) {
        newBundle.putAll(oldBundle);
    }/*  www . j  a v  a 2 s  . c  o  m*/
}

From source file:Main.java

/**
 * Parse a URL query and fragment parameters into a key-value bundle.
 *//* w  ww .  j a  v  a2s.  c  om*/
public static Bundle parseUrl(String url) {
    // hack to prevent MalformedURLException
    url = url.replace("weiboconnect", "http");
    try {
        URL u = new URL(url);
        Bundle b = decodeUrl(u.getQuery());
        b.putAll(decodeUrl(u.getRef()));
        return b;
    } catch (MalformedURLException e) {
        return new Bundle();
    }
}

From source file:Main.java

public static void addIfNotEmpty(Bundle b, Bundle extra) {
    if (extra != null) {
        b.putAll(extra);
    }
}

From source file:Main.java

public static Bundle parseUrl(String url) {
    url = url.replace("rrconnect", "http");
    try {//from   w ww.  j av  a 2s.c  om
        URL u = new URL(url);
        Bundle b = decodeUrl(u.getQuery());
        b.putAll(decodeUrl(u.getRef()));
        return b;
    } catch (MalformedURLException e) {
        return new Bundle();
    }
}

From source file:Main.java

public static Bundle urlToBundle(String url) {
    int index = url.indexOf("://");
    if (index >= 0) {
        url = "http://" + url.substring(index + 1);
    } else {//from www. jav  a  2  s  . co  m
        url = "http://" + url;
    }

    try {
        URL e = new URL(url);
        Bundle b = decodeUrl(e.getQuery());
        b.putAll(decodeUrl(e.getRef()));
        return b;
    } catch (Throwable var4) {
        return new Bundle();
    }
}

From source file:Main.java

/**
 * Parse a URL query and fragment parameters into a key-value bundle.
 * //from   w  w w.j a v  a 2s. c  om
 * @param url the URL to parse
 * @return a dictionary bundle of keys and values
 */
public static Bundle parseUrl(String url) {
    // hack to prevent MalformedURLException
    url = url.replace("fbconnect", "http");
    try {
        URL u = new URL(url);
        Bundle b = decodeUrl(u.getQuery());
        b.putAll(decodeUrl(u.getRef()));
        return b;
    } catch (MalformedURLException e) {
        return new Bundle();
    }
}

From source file:Main.java

/**
 * Parse a URL query and fragment parameters into a key-value bundle.
 *
 * @param url the URL to parse/*from   w  w w .  j a  v  a 2s .  c  om*/
 * @return a dictionary bundle of keys and values
 */
@Deprecated
public static Bundle parseUrl(String url) {
    // hack to prevent MalformedURLException
    url = url.replace("fbconnect", "http");
    try {
        URL u = new URL(url);
        Bundle b = decodeUrl(u.getQuery());
        b.putAll(decodeUrl(u.getRef()));
        return b;
    } catch (MalformedURLException e) {
        return new Bundle();
    }
}

From source file:Main.java

public static Bundle copyExtras(Intent i) {
    Bundle copy = new Bundle();
    Bundle original = i.getExtras();/*w  w  w .  j a v  a2s . com*/
    if (original != null) {
        copy.putAll(original);
    }
    return copy;

}

From source file:Main.java

public static Bundle parseUrl(String url) {
    url = url.replace("#", "?");
    try {//ww w.j  a v a2 s .  c  o m
        URL u = new URL(url);
        Bundle b = decodeUrl(u.getQuery());
        Bundle ref = decodeUrl(u.getRef());
        if (ref != null)
            b.putAll(ref);
        return b;
    } catch (MalformedURLException e) {
        return new Bundle();
    }
}

From source file:com.github.mobile.ui.ConfirmDialogFragment.java

/**
 * Confirm message and deliver callback to given activity
 *
 * @param activity/*from   w  ww.  ja v  a2 s . c o  m*/
 * @param requestCode
 * @param title
 * @param message
 * @param bundle
 */
public static void show(final FragmentActivity activity, final int requestCode, final String title,
        final String message, final Bundle bundle) {
    Bundle arguments = createArguments(title, message, requestCode);
    if (bundle != null)
        arguments.putAll(bundle);
    show(activity, new ConfirmDialogFragment(), arguments, TAG);
}