Example usage for android.os Bundle putString

List of usage examples for android.os Bundle putString

Introduction

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

Prototype

public void putString(@Nullable String key, @Nullable String value) 

Source Link

Document

Inserts a String value into the mapping of this Bundle, replacing any existing value for the given key.

Usage

From source file:com.mikecorrigan.trainscorekeeper.FragmentButton.java

public static FragmentButton newInstance(int index, JSONObject jsonTab) {
    Log.vc(VERBOSE, TAG, "newInstance: jsonTab=" + jsonTab);

    FragmentButton fragment = new FragmentButton();
    Bundle args = new Bundle();
    args.putInt(ARG_INDEX, index);//from   w w w  .  java2  s .c  om
    args.putString(ARG_TAB_SPEC, jsonTab.toString());
    fragment.setArguments(args);
    return fragment;
}

From source file:com.ryan.ryanreader.fragments.UserProfileDialog.java

public static UserProfileDialog newInstance(final String user) {

    final UserProfileDialog dialog = new UserProfileDialog();

    final Bundle args = new Bundle();
    args.putString("user", user);
    dialog.setArguments(args);// www .j  a  v  a 2  s .c  o  m

    return dialog;
}

From source file:com.ntsync.android.sync.activities.VerifyPaymentProgressDialog.java

/**
 * Creates a Verify Progress Dialog//w w w  .  j  a  va2  s .c  om
 * 
 * @param userName
 * @param pwdSalt
 * @param authtoken
 * @return invisible Dialog
 */
public static VerifyPaymentProgressDialog newInstance(UUID selectedPriceId, String jsonProofOfPayment,
        String accountName) {
    VerifyPaymentProgressDialog dlg = new VerifyPaymentProgressDialog();
    Bundle args = new Bundle();
    args.putString(PARAM_PRICEID, selectedPriceId.toString());
    args.putString(PARAM_PROOFOFPAYMENT, jsonProofOfPayment);
    args.putString(PARAM_ACCOUNTNAME, accountName);
    dlg.setArguments(args);
    return dlg;
}

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("=");
            params.putString(URLDecoder.decode(v[0]), URLDecoder.decode(v[1]));
        }/*from  w w  w  .  j a  v  a  2 s.c om*/
    }
    return params;
}

From source file:com.royclarkson.springagram.GalleryPhotoListFragment.java

public static GalleryPhotoListFragment newInstance(String galleryPhotosUrl) {
    GalleryPhotoListFragment fragment = new GalleryPhotoListFragment();
    Bundle args = new Bundle();
    args.putString(ARG_GALLERY_PHOTOS_URI, galleryPhotosUrl);
    fragment.setArguments(args);//from w ww. j  a  v  a 2 s  . c o m
    return fragment;
}

From source file:com.royclarkson.springagram.GalleryListFragment.java

public static GalleryListFragment newInstance(String galleriesUrl) {
    GalleryListFragment fragment = new GalleryListFragment();
    Bundle args = new Bundle();
    args.putString(ARG_GALLERIES_LIST_URL, galleriesUrl);
    fragment.setArguments(args);//from w ww.j  a  v  a  2  s.  c o m
    return fragment;
}

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("=");
            try {
                params.putString(URLDecoder.decode(v[0], "UTF-8"), URLDecoder.decode(v[1], "UTF-8"));
            } catch (UnsupportedEncodingException e) {
                e.printStackTrace();//from   w  w w.  ja v a  2  s  . com

            }
        }
    }
    return params;
}

From source file:Main.java

@SuppressWarnings("unchecked")
public static Bundle addMapToBundle(HashMap<String, ?> map, Bundle bundle) {
    for (String key : map.keySet()) {
        Object value = map.get(key);
        if (value instanceof String) {
            bundle.putString(key, (String) value);
        } else if (value instanceof Integer) {
            bundle.putInt(key, (Integer) value);
        } else if (value instanceof Double) {
            bundle.putDouble(key, ((Double) value));
        } else if (value instanceof Boolean) {
            bundle.putBoolean(key, (Boolean) value);
        } else if (value instanceof HashMap) {
            bundle.putBundle(key, addMapToBundle((HashMap<String, Object>) value, new Bundle()));
        } else if (value instanceof ArrayList) {
            putArray(key, (ArrayList) value, bundle);
        }//from  ww w  .  j  a va  2  s . c  o  m
    }
    return bundle;
}

From source file:com.miz.mizuu.fragments.ActorBrowserFragment.java

public static ActorBrowserFragment newInstance(String movieId) {
    ActorBrowserFragment pageFragment = new ActorBrowserFragment();
    Bundle bundle = new Bundle();
    bundle.putString("movieId", movieId);
    pageFragment.setArguments(bundle);//  w ww.j  a  v  a 2s. c  o  m
    return pageFragment;
}

From source file:com.ntsync.android.sync.activities.LoginProgressDialog.java

/**
 * Creates a new Key// w w  w. j  a  v a  2s  . c o m
 * 
 * @param userName
 * @param pwdSalt
 * @param authtoken
 * @return invisible Dialog
 */
public static LoginProgressDialog newInstance(String username, String password) {
    LoginProgressDialog dlg = new LoginProgressDialog();

    Bundle args = new Bundle();
    args.putString(PARAM_USERNAME, username);
    args.putString(PARAM_PWD, password);

    dlg.setArguments(args);
    return dlg;
}