public I arg(String key, String[] value) { args.putStringArray(key, value); return (I) this; }
/** * Inserts a String array value into the mapping of this Bundle, replacing * any existing value for the given key. Either key or value may be null. * * @param key a String, or null * @param value a String array object, or null */ public Bundler putStringArray(String key, String[] value) { bundle.putStringArray(key, value); return this; }
/** * Inserts a String array value into the mapping of this Bundle, replacing * any existing value for the given key. Either key or value may be null. * * @param key a String, or null * @param value a String array object, or null */ public Bundler putStringArray(String key, String[] value) { bundle.putStringArray(key, value); return this; }
/** * Sets the passed in value for the passed in key. This will override any previous calls * with the same key. * * @param key Key for the argument * @param arrayValue Value of the argument * @return This Builder instance */ public Builder putArgument(final String key, final String[] arrayValue) { params.putStringArray(key, arrayValue); return this; }
public void onSaveInstanceState(Bundle savedState) { super.onSaveInstanceState(savedState); // Note: getValues() is a method in your ArrayAdapter subclass String[] values = mAdapter.getValues(); savedState.putStringArray("myKey", values); }
public BundleBuilder putStringArray(String key, String[] value) { bundle.putStringArray(key, value); return this; }
/** * Inserts a String array value into the mapping of the underlying Bundle, replacing any existing * value for the given key. Either key or value may be null. * * @param key a String, or null * @param value a String array object, or null * @return this bundler instance to chain method calls */ public Bundler put(String key, String[] value) { delegate.putStringArray(key, value); return this; }
@NonNull private Bundle prepareIntentExtras(Recipient recipient) { Address address = recipient.address; Bundle extras = new Bundle(); extras.putStringArray(Intent.EXTRA_EMAIL, new String[] { address.toString() }); extras.putStringArray(Intent.EXTRA_CC, new String[0]); extras.putStringArray(Intent.EXTRA_BCC, new String[0]); return extras; }
Bundle toBundle() { Bundle bundle = new Bundle(); bundle.putString(KEY_POSITIVE_BUTTON, positiveButton); bundle.putString(KEY_NEGATIVE_BUTTON, negativeButton); bundle.putString(KEY_RATIONALE_MESSAGE, rationaleMsg); bundle.putInt(KEY_THEME, theme); bundle.putInt(KEY_REQUEST_CODE, requestCode); bundle.putStringArray(KEY_PERMISSIONS, permissions); return bundle; }
Bundle b=new Bundle(); b.putStringArray(key, new String[]{value1, value2}); Intent i=new Intent(context, Class); i.putExtras(b);
public static AddDownTask newIntance(String[] ids, String[] names, String[] artists) { AddDownTask addDownTask = new AddDownTask(); Bundle bundle = new Bundle(); bundle.putStringArray("ids", ids); bundle.putStringArray("names", names); bundle.putStringArray("artists", artists); addDownTask.setArguments(bundle); return addDownTask; }
Bundle b=new Bundle(); b.putStringArray(key, new String[]{value1, value2}); Intent i=new Intent(context, Class); i.putExtras(b);
public static SlideFragment createInstance(SlideFragmentBuilder builder) { SlideFragment slideFragment = new SlideFragment(); Bundle bundle = new Bundle(); bundle.putInt(BACKGROUND_COLOR, builder.backgroundColor); bundle.putInt(BUTTONS_COLOR, builder.buttonsColor); bundle.putInt(IMAGE, builder.image); bundle.putString(TITLE, builder.title); bundle.putString(DESCRIPTION, builder.description); bundle.putStringArray(NEEDED_PERMISSIONS, builder.neededPermissions); bundle.putStringArray(POSSIBLE_PERMISSIONS, builder.possiblePermissions); slideFragment.setArguments(bundle); return slideFragment; }
public static ConfirmationDialogFragment newInstance(@StringRes int message, String[] permissions, int requestCode, @StringRes int notGrantedMessage) { ConfirmationDialogFragment fragment = new ConfirmationDialogFragment(); Bundle args = new Bundle(); args.putInt(ARG_MESSAGE, message); args.putStringArray(ARG_PERMISSIONS, permissions); args.putInt(ARG_REQUEST_CODE, requestCode); args.putInt(ARG_NOT_GRANTED_MESSAGE, notGrantedMessage); fragment.setArguments(args); return fragment; }
public static final TabPagerFragment newInstance(int page, String[] title) { TabPagerFragment f = new TabPagerFragment(); Bundle bdl = new Bundle(1); bdl.putInt("page_number", page); bdl.putStringArray("title", title); f.setArguments(bdl); return f; }
public static ImagePagerFragment newInstance(List<String> paths, int currentItem) { ImagePagerFragment f = new ImagePagerFragment(); Bundle args = new Bundle(); args.putStringArray(ARG_PATH, paths.toArray(new String[paths.size()])); args.putInt(ARG_CURRENT_ITEM, currentItem); f.setArguments(args); return f; }
@Override public Parcelable saveState() { Bundle bundle = new Bundle(); bundle.putBoolean(KEY_SAVES_STATE, savesState); bundle.putSparseParcelableArray(KEY_SAVED_PAGES, savedPages); int[] visiblePageIdsKeys = new int[visiblePageIds.size()]; String[] visiblePageIdsValues = new String[visiblePageIds.size()]; for (int i = 0; i < visiblePageIds.size(); i++) { visiblePageIdsKeys[i] = visiblePageIds.keyAt(i); visiblePageIdsValues[i] = visiblePageIds.valueAt(i); } bundle.putIntArray(KEY_VISIBLE_PAGE_IDS_KEYS, visiblePageIdsKeys); bundle.putStringArray(KEY_VISIBLE_PAGE_IDS_VALUES, visiblePageIdsValues); return bundle; }
private void onComplete(int requestCode, String[] permissions, int[] grantResult) { Bundle bundle = new Bundle(); bundle.putStringArray("permissions", permissions); bundle.putIntArray("grantResult", grantResult); bundle.putInt("requestCode", requestCode); // Send our callback to the result receiver resultReceiver.send(requestCode, bundle); finish(); }
public static Bundle create(SharePhotoContent sharePhotoContent) { final Bundle params = createBaseParameters(sharePhotoContent); final String[] urls = new String[sharePhotoContent.getPhotos().size()]; Utility.map( sharePhotoContent.getPhotos(), new Utility.Mapper<SharePhoto, String>() { @Override public String apply(SharePhoto item) { return item.getImageUrl().toString(); } }).toArray(urls); params.putStringArray(ShareConstants.WEB_DIALOG_PARAM_MEDIA ,urls); return params; }
@Test public void stringArray() { bundle.putStringArray("foo", new String[] { "a" }); assertThat(bundle.getStringArray("foo")).isEqualTo(new String[]{"a"}); assertThat(bundle.getStringArray("bar")).isNull(); }