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.connectbot.HostEditorFragment.java

@Override
public void onSaveInstanceState(Bundle savedInstanceState) {
    super.onSaveInstanceState(savedInstanceState);

    savedInstanceState.putLong(ARG_EXISTING_HOST_ID, mHost.getId());
    savedInstanceState.putParcelable(ARG_EXISTING_HOST, mHost.getValues());
    savedInstanceState.putBoolean(ARG_IS_EXPANDED, mIsUriEditorExpanded);
    savedInstanceState.putString(ARG_QUICKCONNECT_STRING, mQuickConnectField.getText().toString());
    savedInstanceState.putStringArrayList(ARG_PUBKEY_NAMES, mPubkeyNames);
    savedInstanceState.putStringArrayList(ARG_PUBKEY_VALUES, mPubkeyValues);
}

From source file:net.inbox.InboxSend.java

/**
 * Starts GPG message work.//from  www . j av a 2  s .  c om
 **/
private void gpg_crypto_start() {
    // Testing attachments
    boolean empty_contents = et_contents.getText().toString().isEmpty();
    boolean mime_attachments = attachment_paths.size() > 0;
    if (empty_contents && !mime_attachments) {
        // No encryption required
        crypto_locked = true;
        crypto_padlock();
        tv_encryption_reset.setVisibility(View.VISIBLE);
    } else {
        // Encryption required
        Intent gpg = new Intent(this, InboxGPG.class);
        Bundle b = new Bundle();
        String s_rcpt = et_to.getText().toString();
        if (sw_cc.isChecked() && et_cc.getText().length() > 0) {
            s_rcpt += "," + et_cc.getText().toString();
        }
        if (sw_bcc.isChecked() && et_bcc.getText().length() > 0) {
            s_rcpt += "," + et_bcc.getText().toString();
        }
        b.putString("recipients", s_rcpt);
        if (mime_attachments)
            b.putStringArrayList("attachments", attachment_paths);

        // Message text
        current.set_contents_crypto(null);
        msg_contents = et_contents.getText().toString();
        b.putString("message-data", msg_contents);

        b.putInt("request-code", 91);
        gpg = gpg.putExtras(b);
        startActivityForResult(gpg, 91, null);
        overridePendingTransition(R.anim.left_in, R.anim.left_out);
    }
}

From source file:com.segma.trim.InAppBillingUtilities.InAppBillingHelper.java

int querySkuDetails(String itemType, Inventory inv, List<String> moreSkus)
        throws RemoteException, JSONException {
    logDebug("Querying SKU details.");
    ArrayList<String> skuList = new ArrayList<String>();
    skuList.addAll(inv.getAllOwnedSkus(itemType));
    if (moreSkus != null) {
        for (String sku : moreSkus) {
            if (!skuList.contains(sku)) {
                skuList.add(sku);/* w w  w  . j  a  va  2s. c  o m*/
            }
        }
    }

    if (skuList.size() == 0) {
        logDebug("queryPrices: nothing to do because there are no SKUs.");
        return BILLING_RESPONSE_RESULT_OK;
    }

    // Split the sku list in blocks of no more than 20 elements.
    ArrayList<ArrayList<String>> packs = new ArrayList<ArrayList<String>>();
    ArrayList<String> tempList;
    int n = skuList.size() / 20;
    int mod = skuList.size() % 20;
    for (int i = 0; i < n; i++) {
        tempList = new ArrayList<String>();
        for (String s : skuList.subList(i * 20, i * 20 + 20)) {
            tempList.add(s);
        }
        packs.add(tempList);
    }
    if (mod != 0) {
        tempList = new ArrayList<String>();
        for (String s : skuList.subList(n * 20, n * 20 + mod)) {
            tempList.add(s);
        }
        packs.add(tempList);
    }

    for (ArrayList<String> skuPartList : packs) {
        Bundle querySkus = new Bundle();
        querySkus.putStringArrayList(GET_SKU_DETAILS_ITEM_LIST, skuPartList);
        Bundle skuDetails = mService.getSkuDetails(3, mContext.getPackageName(), itemType, querySkus);

        if (!skuDetails.containsKey(RESPONSE_GET_SKU_DETAILS_LIST)) {
            int response = getResponseCodeFromBundle(skuDetails);
            if (response != BILLING_RESPONSE_RESULT_OK) {
                logDebug("getSkuDetails() failed: " + getResponseDesc(response));
                return response;
            } else {
                logError("getSkuDetails() returned a bundle with neither an error nor a detail list.");
                return IABHELPER_BAD_RESPONSE;
            }
        }

        ArrayList<String> responseList = skuDetails.getStringArrayList(RESPONSE_GET_SKU_DETAILS_LIST);

        for (String thisResponse : responseList) {
            StockKeepingUnitDetails d = new StockKeepingUnitDetails(itemType, thisResponse);
            logDebug("Got sku details: " + d);
            inv.addSkuDetails(d);
        }
    }

    return BILLING_RESPONSE_RESULT_OK;
}

From source file:com.spoiledmilk.ibikecph.navigation.SMRouteNavigationActivity.java

public void launchReportIssuesActivity() {
    Intent i = new Intent(SMRouteNavigationActivity.this, IssuesActivity.class);
    Bundle b = new Bundle();
    generateTurnStrings();/*from   www .  ja v a  2 s .  c om*/
    b.putStringArrayList("turns", turns);
    i.putExtras(b);
    startActivity(i);
    overridePendingTransition(R.anim.slide_in_right, R.anim.slide_out_left);
}

From source file:com.morlunk.mumbleclient.app.PlumbleActivity.java

/**
 * Loads a fragment from the drawer./*from w w  w .j a  v a2 s  . co  m*/
 */
private void loadDrawerFragment(int fragmentId) {
    Class<? extends Fragment> fragmentClass = null;
    Bundle args = new Bundle();
    switch (fragmentId) {
    case DrawerAdapter.ITEM_SERVER:
        fragmentClass = ChannelFragment.class;
        break;
    case DrawerAdapter.ITEM_INFO:
        fragmentClass = ServerInfoFragment.class;
        break;
    case DrawerAdapter.ITEM_ACCESS_TOKENS:
        fragmentClass = AccessTokenFragment.class;
        args.putLong("server", mService.getConnectedServer().getId());
        args.putStringArrayList("access_tokens",
                (ArrayList<String>) mDatabase.getAccessTokens(mService.getConnectedServer().getId()));
        break;
    case DrawerAdapter.ITEM_PINNED_CHANNELS:
        fragmentClass = ChannelFragment.class;
        args.putBoolean("pinned", true);
        break;
    case DrawerAdapter.ITEM_FAVOURITES:
        fragmentClass = FavouriteServerListFragment.class;
        break;
    case DrawerAdapter.ITEM_PUBLIC:
        fragmentClass = PublicServerListFragment.class;
        break;
    case DrawerAdapter.ITEM_SETTINGS:
        Intent prefIntent = new Intent(this, Preferences.class);
        startActivity(prefIntent);
        return;
    default:
        return;
    }
    Fragment fragment = Fragment.instantiate(this, fragmentClass.getName(), args);
    getSupportFragmentManager().beginTransaction()
            .replace(R.id.content_frame, fragment, fragmentClass.getName())
            .setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE).commit();
    setTitle(mDrawerAdapter.getItemWithId(fragmentId).title);
}

From source file:com.hijridatepicker.HijriDatePickerAndroidModule.java

private Bundle createFragmentArguments(ReadableMap options, Promise promise) {
    final Bundle args = new Bundle();
    try {//  w ww .  j a  v  a2  s  .c o  m
        if (options.hasKey(ARG_DATE) && !options.isNull(ARG_DATE)) {
            if (!parseOptionsWithKey(ARG_DATE, options, args, promise))
                return null;
        }
        if (options.hasKey(ARG_MINDATE) && !options.isNull(ARG_MINDATE)) {
            if (!parseOptionsWithKey(ARG_MINDATE, options, args, promise))
                return null;
        }
        if (options.hasKey(ARG_MAXDATE) && !options.isNull(ARG_MAXDATE)) {
            if (!parseOptionsWithKey(ARG_MAXDATE, options, args, promise))
                return null;
        }
        if (options.hasKey(ARG_MODE) && !options.isNull(ARG_MODE)) {
            args.putString(ARG_MODE, options.getString(ARG_MODE));
        }
        if (options.hasKey(ARG_WEEK_DAY_LABELS) && !options.isNull(ARG_WEEK_DAY_LABELS)) {
            args.putStringArrayList(ARG_WEEK_DAY_LABELS,
                    toStringArrayList(options.getArray(ARG_WEEK_DAY_LABELS)));
        }
    } catch (Exception e) {
        promise.reject(ERROR_PARSING_OPTIONS,
                "Exception happened while parsing options, details: " + e.getMessage());
        return null;
    }
    return args;
}

From source file:com.terracom.mumbleclient.app.QRPushToTalkActivity.java

/**
 * Loads a fragment from the drawer.// w w w  . j a  v a 2 s . co m
 */
private void loadDrawerFragment(int fragmentId) {
    Class<? extends Fragment> fragmentClass = null;
    Bundle args = new Bundle();
    switch (fragmentId) {
    case DrawerAdapter.ITEM_SERVER:
        fragmentClass = ChannelFragment.class;
        break;
    case DrawerAdapter.ITEM_INFO:
        fragmentClass = ServerInfoFragment.class;
        break;
    case DrawerAdapter.ITEM_ACCESS_TOKENS:
        fragmentClass = AccessTokenFragment.class;
        try {
            args.putLong("server", mService.getConnectedServer().getId());
            args.putStringArrayList("access_tokens",
                    (ArrayList<String>) mDatabase.getAccessTokens(mService.getConnectedServer().getId()));
        } catch (RemoteException e) {
            e.printStackTrace();
        }
        break;
    case DrawerAdapter.ITEM_PINNED_CHANNELS:
        fragmentClass = ChannelFragment.class;
        args.putBoolean("pinned", true);
        break;
    case DrawerAdapter.ITEM_FAVOURITES:
        fragmentClass = FavouriteServerListFragment.class;
        break;
    case DrawerAdapter.ITEM_PUBLIC:
        fragmentClass = PublicServerListFragment.class;
        break;
    case DrawerAdapter.ITEM_SETTINGS:
        Intent prefIntent = new Intent(this, Preferences.class);
        startActivity(prefIntent);
        return;
    default:
        return;
    }
    Fragment fragment = Fragment.instantiate(this, fragmentClass.getName(), args);
    getSupportFragmentManager().beginTransaction()
            .replace(R.id.content_frame, fragment, fragmentClass.getName())
            .setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE).commit();
    setTitle(mDrawerAdapter.getItemWithId(fragmentId).title);
}

From source file:com.emergencyskills.doe.aed.UI.activity.TabsActivity.java

public void addnewinstall(ArrayList serialnums, String schoolid, String principal, String contact,
        String schoolcode, String address, String phone, String aedemail, String principalemail, String drillis,
        int pos, String contactphone, String state, String city, String zip) {
    ll4.setBackgroundColor(getResources().getColor(R.color.White));
    ll2.setBackgroundColor(getResources().getColor(R.color.FullTransparent));
    ll3.setBackgroundColor(getResources().getColor(R.color.FullTransparent));
    ll1.setBackgroundColor(getResources().getColor(R.color.FullTransparent));
    ll5.setBackgroundColor(getResources().getColor(R.color.FullTransparent));
    FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
    Addnewinstall myf = new Addnewinstall();
    Bundle bundle = new Bundle();
    bundle.putString("schoolid", schoolid);
    bundle.putString("principal", principal);
    bundle.putString("contact", contact);
    bundle.putString("schoolcode", schoolcode);
    bundle.putString("address", address);
    bundle.putString("phone", phone);
    bundle.putString("contactemail", aedemail);
    bundle.putString("principalemail", principalemail);
    bundle.putString("installid", drillis);
    bundle.putStringArrayList("serialnumbers", serialnums);
    bundle.putInt("pos", pos);
    bundle.putString("contactphone", contactphone);
    bundle.putString("state", state);
    bundle.putString("city", city);
    bundle.putString("zip", zip);
    myf.setArguments(bundle);/* w  ww .j ava2s  . c  o  m*/
    transaction.setCustomAnimations(android.R.anim.slide_in_left, android.R.anim.slide_out_right);
    transaction.replace(R.id.frame, myf, "Newinstall");
    transaction.addToBackStack(null);
    transaction.commit();
}

From source file:com.cerema.cloud2.ui.activity.Uploader.java

@Override
protected void onSaveInstanceState(Bundle outState) {
    Log_OC.d(TAG, "onSaveInstanceState() start");
    super.onSaveInstanceState(outState);
    outState.putSerializable(KEY_PARENTS, mParents);
    //outState.putParcelable(KEY_ACCOUNT, mAccount);
    outState.putParcelable(KEY_FILE, mFile);
    outState.putBoolean(KEY_ACCOUNT_SELECTED, mAccountSelected);
    outState.putBoolean(KEY_ACCOUNT_SELECTION_SHOWING, mAccountSelectionShowing);
    outState.putInt(KEY_NUM_CACHE_FILE, mNumCacheFile);
    outState.putStringArrayList(KEY_REMOTE_CACHE_DATA, mRemoteCacheData);
    outState.putParcelable(FileActivity.EXTRA_ACCOUNT, getAccount());

    Log_OC.d(TAG, "onSaveInstanceState() end");
}

From source file:androidx.navigation.NavController.java

/**
 * Saves all navigation controller state to a Bundle.
 *
 * <p>State may be restored from a bundle returned from this method by calling
 * {@link #restoreState(Bundle)}. Saving controller state is the responsibility
 * of a {@link NavHost}.</p>/*from ww  w  .  j  av  a  2 s.com*/
 *
 * @return saved state for this controller
 */
@Nullable
public Bundle saveState() {
    Bundle b = null;
    if (mGraphId != 0) {
        b = new Bundle();
        b.putInt(KEY_GRAPH_ID, mGraphId);
    }
    ArrayList<String> navigatorNames = new ArrayList<>();
    Bundle navigatorState = new Bundle();
    for (Map.Entry<String, Navigator<? extends NavDestination>> entry : mNavigatorProvider.getNavigators()
            .entrySet()) {
        String name = entry.getKey();
        Bundle savedState = entry.getValue().onSaveState();
        if (savedState != null) {
            navigatorNames.add(name);
            navigatorState.putBundle(name, entry.getValue().onSaveState());
        }
    }
    if (!navigatorNames.isEmpty()) {
        if (b == null) {
            b = new Bundle();
        }
        navigatorState.putStringArrayList(KEY_NAVIGATOR_STATE_NAMES, navigatorNames);
        b.putBundle(KEY_NAVIGATOR_STATE, navigatorState);
    }
    if (!mBackStack.isEmpty()) {
        if (b == null) {
            b = new Bundle();
        }
        int[] backStack = new int[mBackStack.size()];
        int index = 0;
        for (NavDestination destination : mBackStack) {
            backStack[index++] = destination.getId();
        }
        b.putIntArray(KEY_BACK_STACK_IDS, backStack);
    }
    return b;
}