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:com.github.pockethub.android.ui.ConfirmDialogFragment.java

/**
 * Confirm message and deliver callback to given activity
 *
 * @param activity//from   w ww  .j av  a 2  s . c  om
 * @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);
}

From source file:com.github.pennyfive.cinemafinlando.ui.UiUtils.java

public static Bundle intentToArgs(Intent intent) {
    Bundle args = new Bundle();
    if (intent != null) {
        args.putAll(intent.getExtras());
    }/*from  ww w .jav a 2 s .co  m*/
    return args;
}

From source file:Main.java

public static Bundle parseUrl(String url) {
    Bundle ret;
    url = url.replace("bdconnect", "http");
    try {/*from w ww.j  ava2s  .  c  om*/
        URL urlParam = new URL(url);
        ret = decodeUrl(urlParam.getQuery());
        ret.putAll(decodeUrl(urlParam.getRef()));
        return ret;
    } catch (MalformedURLException e) {
        return new Bundle();
    }
}

From source file:cz.muni.fi.japanesedictionary.fragments.DisplaySentenceInfo.java

public static DisplaySentenceInfo newInstance(TatoebaSentence sentence) {
    DisplaySentenceInfo frag = new DisplaySentenceInfo();
    Bundle args = new Bundle();
    args.putAll(sentence.convertToBundle());
    frag.setArguments(args);//from  w w  w .  ja va 2  s.c  o m
    return frag;
}

From source file:org.linkdroid.WebhookPostService.java

public static Bundle newPostDataBundle(Intent originator) {
    Bundle bundle = new Bundle();
    if (originator.getExtras() != null) {
        bundle.putAll(originator.getExtras());
    }//w  w w  .j  a v  a 2  s.  c om
    // Sanitize the linkdroid extras from data bundle in case originating
    // intent extras set them. We do this for all linkdroid Extras except
    // for the SMS extras.
    bundle.remove(Extras.INTENT_ACTION);
    bundle.remove(Extras.INTENT_TYPE);
    bundle.remove(Extras.INTENT_CATEGORIES);
    bundle.remove(Extras.HMAC);
    bundle.remove(Extras.NONCE);
    bundle.remove(Extras.STREAM);
    bundle.remove(Extras.STREAM_HMAC);
    bundle.remove(Extras.STREAM_MIME_TYPE);
    bundle.remove(Extras.USER_INPUT);
    if (originator.getAction() != null) {
        bundle.putString(Extras.INTENT_ACTION, originator.getAction());
    }
    if (originator.getType() != null) {
        bundle.putString(Extras.INTENT_TYPE, originator.getType());
    }
    if (originator.getCategories() != null) {
        bundle.putString(Extras.INTENT_CATEGORIES, StringUtils.join(originator.getCategories(), " "));
    }

    return bundle;
}

From source file:jfabrix101.lib.dialog.MessagePromptDialogFragment.java

public static MessagePromptDialogFragment newInstance(String title, String message, Bundle extraParams,
        DialogResultListener dialogResultListener) {

    MessagePromptDialogFragment adf = new MessagePromptDialogFragment();
    adf.resultListener = dialogResultListener;
    Bundle bundle = new Bundle();
    bundle.putString("message", message);
    bundle.putString("title", title);
    if (extraParams != null)
        bundle.putAll(extraParams);
    adf.setArguments(bundle);/*from www. j  a v a 2  s  .  c  o  m*/
    return adf;
}

From source file:mx.developerbus.foodbus.utl.foodBUtil.java

public static boolean setFragmentWorkspace(boolean multipane, FragmentManager fragmentManager,
        Class<? extends Fragment> fragmentClass, Bundle args, int enter, int exit, int popEnter, int popExit,
        boolean staked) throws Exception {
    boolean replace = false;
    try {// w  w  w. j av a 2  s .c o  m

        if (fragmentClass != null) {
            Fragment fp = fragmentManager.findFragmentById(R.id.frgWorkspace);
            FragmentTransaction tra = fragmentManager.beginTransaction();

            if (enter > 0 && exit > 0 && popEnter > 0 && popExit > 0) {
                tra.setCustomAnimations(enter, exit, popEnter, popExit);
                tra.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE);
            } else {
                tra.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE);
            }

            Fragment f = fragmentClass.newInstance();
            Bundle b = new Bundle();
            b.putBoolean("multipane", multipane);
            if (args != null) {
                b.putAll(args);
            }
            f.setArguments(b);

            if (fp != null) {
                if (fp.getClass() != fragmentClass) {
                    tra.replace(R.id.frgWorkspace, f);
                    if (staked) {
                        tra.addToBackStack(null);
                    }
                    replace = true;
                }
            } else {
                tra.add(R.id.frgWorkspace, f);
                replace = true;
            }
            tra.commit();
        }
    } catch (Exception e) {
        throw new Exception("ERROR Home - setFragment : " + e.getMessage());
    }
    return replace;
}

From source file:com.familygraph.android.Util.java

/**
 * Parse a URL query and fragment parameters into a key-value bundle.
 * // w w w.jav  a 2s  .c o m
 * @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("fgconnect", "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:illab.nabal.util.ParameterHelper.java

/**
 * Parse a URL query and fragment parameters into a key-value bundle.
 * //from  ww  w  .  j a v  a 2 s.  c  o  m
 * @param url - the URL to parse
 * @return bundle - a dictionary bundle of keys and values
 */
public static Bundle parseGetParams(String url) {

    // prepare a bundle
    Bundle bundle = null;
    try {
        URL u = new URL(url);
        bundle = decodeGetParams(u.getQuery());
        bundle.putAll(decodeGetParams(u.getRef()));
    } catch (MalformedURLException e) {
        Log.e(TAG, "malformed URL");
        Log.e(TAG, e.getMessage());
    }
    return bundle;
}

From source file:Main.java

public static Bundle getBundle(Bundle oldBundle, Bundle newBundle) {
    if (oldBundle == null) {
        if (newBundle == null) {
            return new Bundle();
        } else {//  w w w  . ja  va  2  s  .  co m
            return newBundle;
        }
    } else {
        if (newBundle == null) {
            return new Bundle();
        } else {
            oldBundle.putAll(newBundle);
            return oldBundle;
        }
    }
}