android.content.Intent.putStringArrayListExtra()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(7.7k)|赞(0)|评价(0)|浏览(169)

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

Intent.putStringArrayListExtra介绍

暂无

代码示例

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

public I stringArrayListExtra(String name, ArrayList<String> value) {
  intent.putStringArrayListExtra(name, value);
  return (I) this;
}

代码示例来源:origin: lovetuzitong/MultiImageSelector

private Intent createIntent(Context context){
    Intent intent = new Intent(context, MultiImageSelectorActivity.class);
    intent.putExtra(MultiImageSelectorActivity.EXTRA_SHOW_CAMERA, mShowCamera);
    intent.putExtra(MultiImageSelectorActivity.EXTRA_SELECT_COUNT, mMaxCount);
    if(mOriginData != null){
      intent.putStringArrayListExtra(MultiImageSelectorActivity.EXTRA_DEFAULT_SELECTED_LIST, mOriginData);
    }
    intent.putExtra(MultiImageSelectorActivity.EXTRA_SELECT_MODE, mMode);
    return intent;
  }
}

代码示例来源:origin: iMeiji/Toutiao

public static void start(Context context, String url, ArrayList<String> imgList) {
  Intent starter = new Intent(context, ImageBrowserActivity.class);
  starter.putExtra(EXTRA_URl, url);
  starter.putStringArrayListExtra(EXTRA_LIST, imgList);
  starter.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
  context.startActivity(starter);
}

代码示例来源:origin: Naoki2015/CircleDemo

public static void startImagePagerActivity(Context context, List<String> imgUrls, int position, ImageSize imageSize){
  Intent intent = new Intent(context, ImagePagerActivity.class);
  intent.putStringArrayListExtra(INTENT_IMGURLS, new ArrayList<String>(imgUrls));
  intent.putExtra(INTENT_POSITION, position);
  intent.putExtra(INTENT_IMAGESIZE, imageSize);
  context.startActivity(intent);
}

代码示例来源:origin: TommyLemon/APIJSON

/**启动BottomMenuWindow的Intent
 * @param context
 * @param nameList
 * @param idList
 * @return
 */
public static Intent createIntent(Context context, 
    ArrayList<String> nameList, ArrayList<Integer> idList) {
  return new Intent(context, BottomMenuWindow.class).
      putStringArrayListExtra(INTENT_ITEMS, nameList).
      putIntegerArrayListExtra(INTENT_ITEM_IDS, idList);
}

代码示例来源:origin: TommyLemon/Android-ZBLibrary

/**启动BottomMenuWindow的Intent
 * @param context
 * @param nameList
 * @param idList
 * @return
 */
public static Intent createIntent(Context context,
    ArrayList<String> nameList, ArrayList<Integer> idList) {
  return new Intent(context, BottomMenuWindow.class).
      putStringArrayListExtra(INTENT_ITEMS, nameList).
      putIntegerArrayListExtra(INTENT_ITEM_IDS, idList);
}

代码示例来源:origin: TommyLemon/APIJSON

/**启动TopMenuWindow的Intent
 * @param context
 * @param title - 非必需
 * @param nameList
 * @param intentCodeList
 * @return
 */
public static Intent createIntent(Context context,
    ArrayList<String> nameList, ArrayList<Integer> intentCodeList) {
  return new Intent(context, TopMenuWindow.class).
      putStringArrayListExtra(INTENT_NAMES, nameList).
      putIntegerArrayListExtra(INTENT_INTENTCODES, intentCodeList);
}

代码示例来源:origin: TommyLemon/Android-ZBLibrary

/**启动TopMenuWindow的Intent
 * @param context
 * @param nameList
 * @param intentCodeList
 * @return
 */
public static Intent createIntent(Context context,
    ArrayList<String> nameList, ArrayList<Integer> intentCodeList) {
  return new Intent(context, TopMenuWindow.class).
      putStringArrayListExtra(INTENT_NAMES, nameList).
      putIntegerArrayListExtra(INTENT_INTENTCODES, intentCodeList);
}

代码示例来源:origin: jaydenxiao2016/AndroidFire

public static void startImagePagerActivity(Activity activity, List<String> imgUrls, int position){
  Intent intent = new Intent(activity, BigImagePagerActivity.class);
  intent.putStringArrayListExtra(INTENT_IMGURLS, new ArrayList<String>(imgUrls));
  intent.putExtra(INTENT_POSITION, position);
  activity.startActivity(intent);
  activity.overridePendingTransition(R.anim.fade_in,
      R.anim.fade_out);
}
/**

代码示例来源:origin: jaydenxiao2016/AndroidFire

public void exit() {
  Intent intent = new Intent();
  result.clear();
  result.addAll(Constant.imageList);
  intent.putStringArrayListExtra(INTENT_RESULT, result);
  setResult(RESULT_OK, intent);
  Constant.imageList.clear();
  finish();
}

代码示例来源:origin: TommyLemon/APIJSON

@Override
protected void setResult() {
  setResult(RESULT_OK, new Intent().putStringArrayListExtra(
      RESULT_PLACE_LIST, containerView.getSelectedItemList()));
}

代码示例来源:origin: lovetuzitong/MultiImageSelector

@Override
public void onSingleImageSelected(String path) {
  Intent data = new Intent();
  resultList.add(path);
  data.putStringArrayListExtra(EXTRA_RESULT, resultList);
  setResult(RESULT_OK, data);
  finish();
}

代码示例来源:origin: GitLqr/LQRWeChat

public void addGroupMembers() {
  ArrayList<String> selectedIds = new ArrayList<>(mSelectedData.size());
  for (int i = 0; i < mSelectedData.size(); i++) {
    Friend friend = mSelectedData.get(i);
    selectedIds.add(friend.getUserId());
  }
  Intent data = new Intent();
  data.putStringArrayListExtra("selectedIds", selectedIds);
  mContext.setResult(Activity.RESULT_OK, data);
  mContext.finish();
}

代码示例来源:origin: TommyLemon/Android-ZBLibrary

@Override
protected void setResult() {
  setResult(RESULT_OK, new Intent().putStringArrayListExtra(
      RESULT_PLACE_LIST, containerView.getSelectedItemList()));
}

代码示例来源:origin: GitLqr/LQRWeChat

@Override
public void initListener() {
  mBtnToolbarSend.setOnClickListener(v -> {
    ArrayList<String> selectedIds = new ArrayList<>(mSelectedData.size());
    for (int i = 0; i < mSelectedData.size(); i++) {
      GroupMember groupMember = mSelectedData.get(i);
      selectedIds.add(groupMember.getUserId());
    }
    Intent data = new Intent();
    data.putStringArrayListExtra("selectedIds", selectedIds);
    setResult(Activity.RESULT_OK, data);
    finish();
  });
}

代码示例来源:origin: lovetuzitong/MultiImageSelector

@Override
  public void onCameraShot(File imageFile) {
    if(imageFile != null) {
      // notify system the image has change
      sendBroadcast(new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE, Uri.fromFile(imageFile)));

      Intent data = new Intent();
      resultList.add(imageFile.getAbsolutePath());
      data.putStringArrayListExtra(EXTRA_RESULT, resultList);
      setResult(RESULT_OK, data);
      finish();
    }
  }
}

代码示例来源:origin: lovetuzitong/MultiImageSelector

@Override
  public void onClick(View view) {
    if(resultList != null && resultList.size() >0){
      // Notify success
      Intent data = new Intent();
      data.putStringArrayListExtra(EXTRA_RESULT, resultList);
      setResult(RESULT_OK, data);
    }else{
      setResult(RESULT_CANCELED);
    }
    finish();
  }
});

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

@Override
public boolean onOptionsItemSelected(MenuItem item) {
 if (item.getItemId() == android.R.id.home) {
  super.onBackPressed();
  return true;
 }
 if (item.getItemId() == R.id.done) {
  Intent intent = new Intent();
  ArrayList<String> selectedPhotos = null;
  if(pickerFragment != null){
   selectedPhotos = pickerFragment.getPhotoGridAdapter().getSelectedPhotoPaths();
  }
  //当在列表没有选择图片,又在详情界面时默认选择当前图片
  if(selectedPhotos.size() <= 0){
   if(imagePagerFragment != null && imagePagerFragment.isResumed()){
    // 预览界面
    selectedPhotos = imagePagerFragment.getCurrentPath();
   }
  }
  if(selectedPhotos != null && selectedPhotos.size() > 0){
   intent.putStringArrayListExtra(KEY_SELECTED_PHOTOS, selectedPhotos);
   setResult(RESULT_OK, intent);
   finish();
  }
  return true;
 }
 return super.onOptionsItemSelected(item);
}

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

@Test
public void putStringArrayListExtra_addsListToExtras() {
 Intent intent = new Intent();
 final ArrayList<String> strings = new ArrayList<>(Arrays.asList("hi", "there"));
 intent.putStringArrayListExtra("KEY", strings);
 assertThat(intent.getStringArrayListExtra("KEY")).isEqualTo(strings);
 assertThat(intent.getExtras().getStringArrayList("KEY")).isEqualTo(strings);
}

代码示例来源:origin: zhihu/Matisse

result.putParcelableArrayListExtra(EXTRA_RESULT_SELECTION, selectedUris);
ArrayList<String> selectedPaths = (ArrayList<String>) mSelectedCollection.asListOfString();
result.putStringArrayListExtra(EXTRA_RESULT_SELECTION_PATH, selectedPaths);
result.putExtra(EXTRA_RESULT_ORIGINAL_ENABLE, mOriginalEnable);
setResult(RESULT_OK, result);

相关文章

Intent类方法