Example usage for android.os Bundle Bundle

List of usage examples for android.os Bundle Bundle

Introduction

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

Prototype

public Bundle() 

Source Link

Document

Constructs a new, empty Bundle.

Usage

From source file:Main.java

public static Bundle getBundle() {
    return new Bundle();
}

From source file:Main.java

public static Bundle getStringAsBundle(String message) {
    Bundle b = new Bundle();
    b.putString("message", message);
    return b;
}

From source file:Main.java

public static Bundle newInstance() {
    return new Bundle();
}

From source file:Main.java

public static Bundle copyExtras(Intent i) {
    Bundle copy = new Bundle();
    Bundle original = i.getExtras();/*from w  ww .j a  v a 2  s.c  om*/
    if (original != null) {
        copy.putAll(original);
    }
    return copy;

}

From source file:Main.java

public static Bundle toBundle(Map<String, String> input) {
    Bundle output = new Bundle();
    for (String key : input.keySet()) {
        output.putString(key, input.get(key));
    }/*w w w .ja  v a2s . c o m*/
    return output;
}

From source file:Main.java

public static Bundle mapToBundle(Map<String, String> map) {
    Bundle bundle = new Bundle();
    for (String key : map.keySet()) {
        bundle.putString(key, map.get(key));
    }/*from   w w  w  .  j av a 2 s.  c  o  m*/
    return bundle;
}

From source file:Main.java

public static Bundle mapToBundle(Map<String, String> map) {
    Bundle bundle = new Bundle();
    if (map != null) {
        for (String key : map.keySet()) {
            bundle.putString(key, map.get(key));
        }//www.j ava2s. com
    }
    return bundle;
}

From source file:Main.java

public static Bundle decodeUrl(String s) {
    Bundle params = new Bundle();
    if (s != null) {
        String array[] = s.split("&");
        for (String parameter : array) {
            String v[] = parameter.split("=");
            // YG: in case param has no value
            if (v.length == 2) {
                params.putString(URLDecoder.decode(v[0]), URLDecoder.decode(v[1]));
            } else {
                params.putString(URLDecoder.decode(v[0]), " ");
            }/*w  w w. ja  v  a2 s .  com*/
        }
    }
    return params;
}

From source file:Main.java

public static void putDataIntoIntent(Intent intent, String str) {
    Bundle bundle = new Bundle();
    bundle.putString("data", str);
    intent.putExtra("data", bundle);
}

From source file:Main.java

public static Bundle getSingleObjectBundle(String key, Serializable obj) {
    Bundle bundle = new Bundle();
    bundle.putSerializable(key, obj);/*from   ww  w  . ja  va 2  s  . c  o m*/
    return bundle;
}