Example usage for android.os Bundle putStringArrayList

List of usage examples for android.os Bundle putStringArrayList

Introduction

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

Prototype

@Override
public void putStringArrayList(@Nullable String key, @Nullable ArrayList<String> value) 

Source Link

Document

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

Usage

From source file:org.cvasilak.jboss.mobile.app.fragments.OperationsViewFragment.java

public static OperationsViewFragment newInstance(ArrayList<String> path) {
    OperationsViewFragment f = new OperationsViewFragment();

    Bundle args = new Bundle();
    args.putStringArrayList("path", path);

    f.setArguments(args);//  w  w  w .  java2  s . co m

    return f;
}

From source file:com.owncloud.android.ui.dialog.LoginWebViewDialog.java

/**
 * Public factory method to get dialog instances.
 *
 * @param url           Url to open at WebView.
 * @param targetUrls     Url signaling the success of the authentication, when loaded.
 * @return              New dialog instance, ready to show.
 *//*from  ww  w  .j  av  a2  s . co m*/
public static LoginWebViewDialog newInstance(String url, ArrayList<String> targetUrls,
        AuthenticationMethod authenticationMethod) {
    if (SAML_WEB_SSO != authenticationMethod) {
        throw new IllegalArgumentException("Only SAML_WEB_SSO authentication method is supported");
    }
    LoginWebViewDialog fragment = new LoginWebViewDialog();
    Bundle args = new Bundle();
    args.putString(ARG_INITIAL_URL, url);
    args.putStringArrayList(ARG_TARGET_URLS, targetUrls);
    args.putInt(ARG_AUTHENTICATION_METHOD, authenticationMethod.getValue());
    fragment.setArguments(args);
    return fragment;
}

From source file:org.cvasilak.jboss.mobile.admin.fragments.ProfileViewFragment.java

public static ProfileViewFragment newInstance(ArrayList<String> path) {
    ProfileViewFragment f = new ProfileViewFragment();

    Bundle args = new Bundle();
    args.putStringArrayList("path", path);

    f.setArguments(args);// w w  w .  java2s. com

    return f;
}

From source file:com.owncloud.android.ui.dialog.WebViewDialog.java

/**
 * Public factory method to get dialog instances.
 *
 * @param url           Url to open at WebView.
 * @param targetUrls     Url signaling the success of the authentication, when loaded.
 * @return              New dialog instance, ready to show.
 *//*from w  w  w.j a  va  2 s. c o m*/
public static WebViewDialog newInstance(String url, ArrayList<String> targetUrls,
        AuthenticationMethod authenticationMethod) {
    if (AuthenticationMethod.BEARER_TOKEN != authenticationMethod
            && AuthenticationMethod.SAML_WEB_SSO != authenticationMethod) {
        throw new IllegalArgumentException(
                "Only SAML_WEB_SSO and BEARER_TOKEN authentication methods are supported");
    }
    WebViewDialog fragment = new WebViewDialog();
    Bundle args = new Bundle();
    args.putString(ARG_INITIAL_URL, url);
    args.putStringArrayList(ARG_TARGET_URLS, targetUrls);
    args.putInt(ARG_AUTHENTICATION_METHOD, authenticationMethod.getValue());
    fragment.setArguments(args);
    return fragment;
}

From source file:com.ruesga.rview.fragments.TagEditDialogFragment.java

public static TagEditDialogFragment newInstance(String title, Tag[] tags, String action, View anchor,
        int requestCode) {
    TagEditDialogFragment fragment = new TagEditDialogFragment();
    Bundle arguments = new Bundle();
    arguments.putString(EXTRA_TITLE, title);
    ArrayList<String> serializedTags = new ArrayList<>(tags.length);
    for (Tag tag : tags) {
        serializedTags.add(tag.toPlainTag().toString());
    }// www . jav  a2 s  .com
    arguments.putStringArrayList(EXTRA_TAGS, serializedTags);
    arguments.putString(EXTRA_ACTION, action);
    arguments.putParcelable(EXTRA_ANCHOR, computeViewOnScreen(anchor));
    arguments.putInt(EXTRA_REQUEST_CODE, requestCode);
    fragment.setArguments(arguments);
    return fragment;
}

From source file:com.microsoft.mimickeralarm.settings.AlarmSettingsFragment.java

public static AlarmSettingsFragment newInstance(String alarmId, ArrayList<String> enabledMimics) {
    AlarmSettingsFragment fragment = new AlarmSettingsFragment();
    Bundle bundle = new Bundle(1);
    bundle.putString(ARGS_ALARM_ID, alarmId);
    bundle.putStringArrayList(ARGS_ENABLED_MIMICS, enabledMimics);
    fragment.setArguments(bundle);//from  w ww. j a v a  2  s  .  c  o  m
    return fragment;
}

From source file:org.akvo.caddisfly.sensor.colorimetry.strip.instructions.InstructionDetailFragment.java

public static InstructionDetailFragment newInstance(JSONArray text, String imageName) {
    InstructionDetailFragment fragment = new InstructionDetailFragment();
    Bundle args = new Bundle();

    ArrayList<String> arrayList = new ArrayList<>();
    if (text != null) {
        for (int i = 0; i < text.length(); i++) {
            try {
                arrayList.add(text.getString(i));
            } catch (JSONException e) {
                Timber.e(e);//from w  ww .j  ava 2 s  .c  o  m
            }
        }
    }

    args.putStringArrayList(ARG_ITEM_TEXT, arrayList);
    args.putString(ARG_ITEM_IMAGE, imageName);
    fragment.setArguments(args);
    return fragment;
}

From source file:com.m2dl.mini_projet.mini_projet_android.fragment.MarkerDialogFragment.java

public static MarkerDialogFragment newInstance(Photo myPhoto) {
    MarkerDialogFragment dialogMarker = new MarkerDialogFragment();
    Bundle args = new Bundle();
    args.putString(ARG_AUTHOR, myPhoto.getAuthor());
    DateFormat dateFormat = DateFormat.getDateTimeInstance(DateFormat.FULL, DateFormat.FULL);
    args.putString(ARG_DATE, dateFormat.format(myPhoto.getDate()));
    ArrayList<String> myArrayList = new ArrayList<>();
    for (Tag tag : myPhoto.getTags()) {
        myArrayList.add(tag.getNom());/*  w  w  w . j  ava 2 s.  co m*/
    }
    args.putStringArrayList(ARG_TAGS, myArrayList);
    args.putString(ARG_URL, myPhoto.getUrl());
    dialogMarker.setArguments(args);
    return dialogMarker;
}

From source file:com.vk.sdk.payments.VKIInAppBillingService.java

private static Receipt getReceipt(@NonNull final Object iInAppBillingService, final int apiVersion,
        @NonNull final String packageName, @NonNull final String receiptOriginal)
        throws JSONException, RemoteException {
    JSONObject objectReceipt = new JSONObject(receiptOriginal);

    Receipt receipt = new Receipt();
    receipt.receiptData = receiptOriginal;
    receipt.quantity = 1;//from ww  w  . j  av  a 2s  . co m

    String sku = objectReceipt.getString(PRODUCT_ID);

    ArrayList<String> skuList = new ArrayList<>();
    skuList.add(sku);

    Bundle queryBundle = new Bundle();
    queryBundle.putStringArrayList(GET_SKU_DETAILS_ITEM_LIST, skuList);
    Bundle responseBundle = getSkuDetails(iInAppBillingService, apiVersion, packageName, "inapp", queryBundle);

    ArrayList<String> responseList = responseBundle.getStringArrayList(RESPONSE_GET_SKU_DETAILS_LIST);
    if (responseList != null && !responseList.isEmpty()) {
        try {
            JSONObject object = new JSONObject(responseList.get(0));
            receipt.priceValue = Float.parseFloat(object.optString(SKU_DETAIL_AMOUNT_MICROS)) / 1000000f;
            receipt.currency = object.optString(SKU_DETAIL_PRICE_CURRENCY_CODE);
        } catch (JSONException e) {
            // nothing
        }
    }
    return receipt;
}

From source file:nz.ac.otago.psyanlab.common.designer.subject.OptionsFragment.java

public static <T extends OptionsFragment> T init(T f, Question q) {
    Bundle args = new Bundle();
    args.putInt(ARG_KIND, q.getKind());//from w w w .ja v  a2 s.  c  o  m
    args.putString(ARG_NAME, q.name);
    args.putString(ARG_TEXT, q.text);
    args.putString(ARG_HINT, q.hint);
    args.putBoolean(ARG_REQUIRED, q.required);
    args.putStringArrayList(ARG_OPTIONS, q.options);
    f.setArguments(args);
    return f;
}