android.os.Bundle.putStringArray()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(7.0k)|赞(0)|评价(0)|浏览(144)

本文整理了Java中android.os.Bundle.putStringArray()方法的一些代码示例,展示了Bundle.putStringArray()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Bundle.putStringArray()方法的具体详情如下:
包路径:android.os.Bundle
类名称:Bundle
方法名:putStringArray

Bundle.putStringArray介绍

暂无

代码示例

代码示例来源:origin: androidannotations/androidannotations

public I arg(String key, String[] value) {
  args.putStringArray(key, value);
  return (I) this;
}

代码示例来源:origin: ogaclejapan/SmartTabLayout

/**
 * 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;
}

代码示例来源:origin: ogaclejapan/SmartTabLayout

/**
 * 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;
}

代码示例来源:origin: facebook/facebook-android-sdk

/**
 * 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;
}

代码示例来源:origin: stackoverflow.com

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);

}

代码示例来源:origin: bluelinelabs/Conductor

public BundleBuilder putStringArray(String key, String[] value) {
  bundle.putStringArray(key, value);
  return this;
}

代码示例来源:origin: f2prateek/dart

/**
 * 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;
}

代码示例来源:origin: k9mail/k-9

@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;
}

代码示例来源:origin: googlesamples/easypermissions

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;
}

代码示例来源:origin: stackoverflow.com

Bundle b=new Bundle();
b.putStringArray(key, new String[]{value1, value2});
Intent i=new Intent(context, Class);
i.putExtras(b);

代码示例来源:origin: aa112901/remusic

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;
}

代码示例来源:origin: stackoverflow.com

Bundle b=new Bundle();
b.putStringArray(key, new String[]{value1, value2});
Intent i=new Intent(context, Class);
i.putExtras(b);

代码示例来源:origin: TangoAgency/material-intro-screen

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;
}

代码示例来源:origin: google/cameraview

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;
}

代码示例来源:origin: aa112901/remusic

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;
}

代码示例来源:origin: donglua/PhotoPicker

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;
}

代码示例来源:origin: bluelinelabs/Conductor

@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;
}

代码示例来源:origin: LawnchairLauncher/Lawnchair

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();
}

代码示例来源:origin: facebook/facebook-android-sdk

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;
}

代码示例来源:origin: robolectric/robolectric

@Test
public void stringArray() {
 bundle.putStringArray("foo", new String[] { "a" });
 assertThat(bundle.getStringArray("foo")).isEqualTo(new String[]{"a"});
 assertThat(bundle.getStringArray("bar")).isNull();
}

相关文章

Bundle类方法