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:csci310.parkhere.ui.activities.GuestActivity.java

public void loadImages(Bundle bundle, ArrayList<String> inputURL) {

    bundle.putStringArrayList("spot_images", inputURL);
}

From source file:com.auth0.lock.util.LockFragmentBuilder.java

public Fragment loginWithSocial() {
    final SocialDBFragment fragment = new SocialDBFragment();
    if (lock.getConfiguration() != null) {
        Bundle bundle = new Bundle();
        bundle.putStringArrayList(SocialDBFragment.SOCIAL_FRAGMENT_STRATEGIES_ARGUMENT,
                activeSocialStrategies());
        bundle.putBoolean(BaseTitledFragment.AUTHENTICATION_USES_EMAIL_ARGUMENT, lock.shouldUseEmail());
        bundle.putSerializable(BaseTitledFragment.AUTHENTICATION_PARAMETER_ARGUMENT,
                new HashMap<>(lock.getAuthenticationParameters()));
        fragment.setArguments(bundle);/*from   w  w  w .  j  a va 2s .c o  m*/
    }
    return fragment;
}

From source file:org.solovyev.android.checkout.GetPurchasesRequestTest.java

@Test
public void testShouldVerifyPurchasesAsynchronously() throws Exception {
    final GetPurchasesRequest request = new GetPurchasesRequest("test", null, new AsyncPurchaseVerifier());
    final PurchasesAwareRequestListener l = new PurchasesAwareRequestListener();
    request.setListener(l);/* w w w . ja v a 2s  .c o  m*/
    final IInAppBillingService service = mock(IInAppBillingService.class);
    final ArrayList<String> list = new ArrayList<String>();
    list.add(PurchaseTest.newJson(0, Purchase.State.REFUNDED));
    list.add(PurchaseTest.newJson(1, Purchase.State.REFUNDED));
    list.add(PurchaseTest.newJson(2, Purchase.State.CANCELLED));
    list.add(PurchaseTest.newJson(3, PURCHASED));
    list.add(PurchaseTest.newJson(4, PURCHASED));
    list.add(PurchaseTest.newJson(5, PURCHASED));
    list.add(PurchaseTest.newJson(6, PURCHASED));
    final Bundle bundle = newBundle(OK);
    bundle.putStringArrayList(Purchases.BUNDLE_DATA_LIST, list);
    when(service.getPurchases(anyInt(), anyString(), anyString(), anyString())).thenReturn(bundle);

    request.start(service, 3, "test");

    assertNotNull(l.purchases);
    assertTrue(l.purchases.list.size() == 4);
}

From source file:com.arcusapp.soundbox.fragment.SongsListFragment.java

private void addRandomButton() {
    // create the button
    Button myButton = new Button(getActivity());
    myButton.setId(19);//  w  w  w. j av a  2s. com
    myButton.setText(this.getString(R.string.LabelPlaySongsRandom));
    myButton.setTextSize(TypedValue.COMPLEX_UNIT_SP, 20);
    myButton.setCompoundDrawablesWithIntrinsicBounds(null, null,
            getResources().getDrawable(R.drawable.icon_random_shuffled), null);
    myButton.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            //start the playActivity
            Intent playActivityIntent = new Intent();
            playActivityIntent.setAction(SoundBoxApplication.ACTION_MAIN_ACTIVITY);
            playActivityIntent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
            getActivity().startActivity(playActivityIntent);

            //call the service to play new songs
            Intent serviceIntent = new Intent(MediaPlayerService.PLAY_NEW_SONGS, null,
                    SoundBoxApplication.getContext(), MediaPlayerService.class);

            Bundle b = new Bundle();
            Collections.shuffle(songsIDs);
            b.putStringArrayList(BundleExtra.SONGS_ID_LIST, new ArrayList<String>(songsIDs));
            b.putString(BundleExtra.CURRENT_ID, BundleExtra.DefaultValues.DEFAULT_ID);

            serviceIntent.putExtras(b);
            getActivity().startService(serviceIntent);
        }
    });

    // add the button to the header of the list
    myListView.addHeaderView(myButton);
}

From source file:net.xisberto.phonetodesktop.LinkListActivity.java

@Override
protected void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);
    outState.putStringArrayList("titles", titles);
    outState.putStringArrayList("ids", ids);
    outState.putBoolean("done", done);
}

From source file:com.secbro.qark.exportedcomponent.exportedactivity.IntentParamsFragment.java

@Override
public void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);
    outState.putStringArrayList(IntentSenderActivity.INTENT_KEYS, keys);
    outState.putString(ExportedActivityListFragment.EXPORTED_ACTIVITY_NAME, exportedActivityName);
    outState.putString(ExportedActivityListFragment.EXPORTED_ACTIVITY_ID, exportedActivityId);
}

From source file:de.sourcestream.movieDB.controller.GalleryList.java

/**
 * Callback method to be invoked when an item in this AdapterView has been clicked.
 *
 * @param parent   The AdapterView where the click happened.
 * @param view     The view within the AdapterView that was clicked (this will be a view provided by the adapter)
 * @param position The position of the view in the adapter.
 * @param id       The row id of the item that was clicked.
 *//*  w  w  w  .ja va2s . c  o m*/
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
    FragmentManager manager = getFragmentManager();
    FragmentTransaction transaction = manager.beginTransaction();
    Bundle args = new Bundle();
    args.putStringArrayList("galleryList", galleryPath);
    args.putInt("currPos", position);
    galleryPreview.setArguments(args);
    transaction.replace(R.id.frame_container, galleryPreview);
    // add the current transaction to the back stack:
    transaction.addToBackStack("galleryList");
    transaction.commit();

}

From source file:eu.faircode.adblocker.IAB.java

public boolean isAvailable(String sku) throws RemoteException, JSONException {
    // Get available SKUs
    ArrayList<String> skuList = new ArrayList<>();
    skuList.add(sku);/*from  w  w  w.ja  va  2s. c o m*/
    Bundle query = new Bundle();
    query.putStringArrayList("ITEM_ID_LIST", skuList);
    Bundle bundle = service.getSkuDetails(IAB_VERSION, context.getPackageName(), "inapp", query);
    Log.i(TAG, "getSkuDetails");
    Util.logBundle(bundle);
    int response = (bundle == null ? -1 : bundle.getInt("RESPONSE_CODE", -1));
    Log.i(TAG, "Response=" + getResult(response));
    if (response != 0)
        throw new IllegalArgumentException(getResult(response));

    // Check available SKUs
    boolean found = false;
    ArrayList<String> details = bundle.getStringArrayList("DETAILS_LIST");
    if (details != null)
        for (String item : details) {
            JSONObject object = new JSONObject(item);
            if (sku.equals(object.getString("productId"))) {
                found = true;
                break;
            }
        }
    Log.i(TAG, sku + "=" + found);

    return found;
}

From source file:com.tangrainc.inappbilling.InAppBillingHelper.java

public ListenableFuture<JSONObject[]> getProducts() {
    return _executor.submit(new Callable<JSONObject[]>() {
        @Override/* w  ww.  ja  va  2  s . c om*/
        public JSONObject[] call() throws Exception {
            // Wait for the service to be initialized (if call too soon after constructor)
            int loop = 0;
            while (_service == null || loop < 20) {
                Thread.sleep(500);
                loop++;
            }
            if (_service == null) {
                throw new Exception(
                        "Billing service could not be connected for 10 secs! May be running on an emulator w/o Google Service?");
            }

            Bundle queryProducts = new Bundle();
            queryProducts.putStringArrayList("ITEM_ID_LIST",
                    new ArrayList<>(Arrays.asList(_productIdentifiers)));

            Bundle productDetails = _service.getSkuDetails(3, _context.getPackageName(), "inapp",
                    queryProducts);
            ArrayList<JSONObject> result = new ArrayList<>();

            int response = productDetails.getInt("RESPONSE_CODE");
            if (response == 0) {
                ArrayList<String> responseList = productDetails.getStringArrayList("DETAILS_LIST");

                for (String thisResponse : responseList) {
                    result.add(new JSONObject(thisResponse));
                }

                return result.toArray(new JSONObject[0]);
            } else {
                throw new Exception("Response from service: " + response);
            }
        }
    });
}

From source file:com.lloydtorres.stately.helpers.NameListDialog.java

@Override
public void onSaveInstanceState(Bundle outState) {
    // Save state
    super.onSaveInstanceState(outState);
    outState.putString(TITLE_KEY, title);
    outState.putStringArrayList(NAMES_KEY, names);
    outState.putInt(TARGET_KEY, target);
}