Java Code Examples for android.content.Intent.putStringArrayListExtra()

The following are Jave code examples for showing how to use putStringArrayListExtra() of the android.content.Intent class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: yyox   File: AttachmentItemClickListener.java   View Source Code Vote up 7 votes
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
    String[] name = list.get(position).getName().split("\\.");
    if (!Utils.isImage(name[1])) {
        return;
    }
    List<String> urls = new ArrayList<>();
    for (int i = 0; i < list.size(); i++) {
        Attachment attachment = list.get(i);
        String[] strings = attachment.getName().split("\\.");
        if (Utils.isImage(strings[1])) {
            urls.add(attachment.getContent_url());
        }
    }
    Intent intent = new Intent(context, ImageActivity.class);
    intent.putExtra(Field.EXTRA_IMAGE_INDEX, urls.indexOf(list.get(position).getContent_url()));
    intent.putStringArrayListExtra(Field.EXTRA_IMAGE_URLS, (ArrayList<String>) urls);
    context.startActivity(intent);
}
 
Example 2
Project: FastAndroid   File: VideoPlugin.java   View Source Code Vote up 7 votes
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
    if (resultCode != Activity.RESULT_OK) {
        return;
    }

    Intent intent = new Intent(RongVoIPIntent.RONG_INTENT_ACTION_VOIP_MULTIVIDEO);
    ArrayList<String> userIds = data.getStringArrayListExtra("invited");
    userIds.add(RongIMClient.getInstance().getCurrentUserId());
    intent.putExtra("conversationType", conversationType.getName().toLowerCase());
    intent.putExtra("targetId", targetId);
    intent.putExtra("callAction", RongCallAction.ACTION_OUTGOING_CALL.getName());
    intent.putStringArrayListExtra("invitedUsers", userIds);
    intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    intent.setPackage(context.getPackageName());
    context.getApplicationContext().startActivity(intent);
}
 
Example 3
Project: FastAndroid   File: RongCallKit.java   View Source Code Vote up 7 votes
/**
 * 开始多人通话。
 * 返回当前会话用户列表提供者对象,用户拿到该对象后,异步从服务器取出当前会话用户列表后,
 * 调用提供者中的 onGotUserList 方法,填充 ArrayList<String> userIds 后,就会自动发起多人通话。
 *
 * @param context          上下文
 * @param conversationType 会话类型
 * @param targetId         会话 id
 * @param mediaType        通话的媒体类型:CALL_MEDIA_TYPE_AUDIO, CALL_MEDIA_TYPE_VIDEO
 * @return 返回当前会话用户列表提供者对象
 */
public static ICallUsersProvider startMultiCall(final Context context, final Conversation.ConversationType conversationType, final String targetId, final CallMediaType mediaType) {
    return new ICallUsersProvider() {
        @Override
        public void onGotUserList(ArrayList<String> userIds) {
            String action;
            if (mediaType.equals(CallMediaType.CALL_MEDIA_TYPE_AUDIO)) {
                action = RongVoIPIntent.RONG_INTENT_ACTION_VOIP_MULTIAUDIO;
            } else {
                action = RongVoIPIntent.RONG_INTENT_ACTION_VOIP_MULTIVIDEO;
            }
            Intent intent = new Intent(action);
            userIds.add(RongIMClient.getInstance().getCurrentUserId());
            intent.putExtra("conversationType", conversationType.getName().toLowerCase());
            intent.putExtra("targetId", targetId);
            intent.putExtra("callAction", RongCallAction.ACTION_OUTGOING_CALL.getName());
            intent.putStringArrayListExtra("invitedUsers", userIds);
            context.startActivity(intent);
        }
    };
}
 
Example 4
Project: Matisse   File: MatisseActivity.java   View Source Code Vote up 7 votes
@Override
public void onClick(View v) {
    if (v.getId() == R.id.button_preview) {
        Intent intent = new Intent(this, SelectedPreviewActivity.class);
        intent.putExtra(BasePreviewActivity.EXTRA_DEFAULT_BUNDLE, mSelectedCollection.getDataWithBundle());
        startActivityForResult(intent, REQUEST_CODE_PREVIEW);
    } else if (v.getId() == R.id.button_apply) {
        Intent result = new Intent();
        ArrayList<Uri> selectedUris = (ArrayList<Uri>) mSelectedCollection.asListOfUri();
        result.putParcelableArrayListExtra(EXTRA_RESULT_SELECTION, selectedUris);
        ArrayList<String> selectedPaths = (ArrayList<String>) mSelectedCollection.asListOfString();
        result.putStringArrayListExtra(EXTRA_RESULT_SELECTION_PATH, selectedPaths);
        setResult(RESULT_OK, result);
        finish();
    }
}
 
Example 5
Project: HenDroid   File: GetInformationThread.java   View Source Code Vote up 7 votes
@Override
public void handleMessage(Message m) {
    pd.dismiss();

    Intent i = new Intent(c, InfoActivity.class);
    i.putStringArrayListExtra("IMAGES", info.getImages());
    i.putExtra("ALBUMNAME", info.getAlbumName());
    i.putExtra("ALBUMSIZE", info.getAlbumSize());
    i.putExtra("ALBUMLANGUAGE", info.getAlbumLanguage());
    i.putExtra("UPLOADER", info.getUploader());
    i.putExtra("UPLOADDATE", info.getUploadDate());
    i.putExtra("SIZE", info.getFileSize());

    // Caso haja algo mais a adicionar, adicione aqui!
    // -----------------------------------------------

    c.startActivity(i);
}
 
Example 6
Project: FastAndroid   File: AudioPlugin.java   View Source Code Vote up 7 votes
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
    if (resultCode != Activity.RESULT_OK) {
        return;
    }

    Intent intent = new Intent(RongVoIPIntent.RONG_INTENT_ACTION_VOIP_MULTIAUDIO);
    ArrayList<String> userIds = data.getStringArrayListExtra("invited");
    userIds.add(RongIMClient.getInstance().getCurrentUserId());
    intent.putExtra("conversationType", conversationType.getName().toLowerCase());
    intent.putExtra("targetId", targetId);
    intent.putExtra("callAction", RongCallAction.ACTION_OUTGOING_CALL.getName());
    intent.putStringArrayListExtra("invitedUsers", userIds);
    intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    intent.setPackage(context.getPackageName());
    context.getApplicationContext().startActivity(intent);
}
 
Example 7
Project: sealtalk-android-master   File: RongCallKit.java   View Source Code Vote up 7 votes
/**
 * 发起多人通话
 *
 * @param context          上下文
 * @param conversationType 会话类型
 * @param targetId         会话 id
 * @param mediaType        会话媒体类型
 * @param userIds          参与者 id 列表
 */
public static void startMultiCall(Context context, Conversation.ConversationType conversationType, String targetId, CallMediaType mediaType, ArrayList<String> userIds) {
    String action;
    if (mediaType.equals(CallMediaType.CALL_MEDIA_TYPE_AUDIO)) {
        action = RongVoIPIntent.RONG_INTENT_ACTION_VOIP_MULTIAUDIO;
    } else {
        action = RongVoIPIntent.RONG_INTENT_ACTION_VOIP_MULTIVIDEO;
    }

    Intent intent = new Intent(action);
    userIds.add(RongIMClient.getInstance().getCurrentUserId());
    intent.putExtra("conversationType", conversationType.getName().toLowerCase());
    intent.putExtra("targetId", targetId);
    intent.putExtra("callAction", RongCallAction.ACTION_OUTGOING_CALL.getName());
    intent.putStringArrayListExtra("invitedUsers", userIds);
    context.startActivity(intent);
}
 
Example 8
Project: Matisse-Image-and-Video-Selector   File: MatisseActivity.java   View Source Code Vote up 7 votes
@Override
public void onClick(View v) {
    if (v.getId() == R.id.button_preview) {
        Intent intent = new Intent(this, SelectedPreviewActivity.class);
        intent.putExtra(BasePreviewActivity.EXTRA_DEFAULT_BUNDLE, mSelectedCollection.getDataWithBundle());
        startActivityForResult(intent, REQUEST_CODE_PREVIEW);
    } else if (v.getId() == R.id.button_apply) {
        Intent result = new Intent();
        ArrayList<Uri> selectedUris = (ArrayList<Uri>) mSelectedCollection.asListOfUri();
        result.putParcelableArrayListExtra(EXTRA_RESULT_SELECTION, selectedUris);
        ArrayList<String> selectedPaths = (ArrayList<String>) mSelectedCollection.asListOfString();
        result.putStringArrayListExtra(EXTRA_RESULT_SELECTION_PATH, selectedPaths);
        setResult(RESULT_OK, result);
        finish();
    }
}
 
Example 9
Project: CIA   File: HomeTabbedActivity.java   View Source Code Vote up 6 votes
/**
 * goes to the CreateHabitActivity
 */
private void onAddHabitClicked() {
    Intent intent = new Intent(this, CreateHabitActivity.class);

    if (user.getHabitCategories() != null) {
        List<String> types = new ArrayList<>();
        types.addAll(user.getHabitCategories());
        intent.putStringArrayListExtra("Categories", (ArrayList<String>) types);
    }

    startActivityForResult(intent, HomeTabbedActivity.VIEW_HABIT);
}
 
Example 10
Project: LQRWeChat-master   File: CreateGroupAtPresenter.java   View Source Code Vote up 6 votes
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();
}
 
Example 11
Project: PicShow-zhaipin   File: ImageZoom.java   View Source Code Vote up 6 votes
/**
 * 跳转到图片预览页面
 *
 * @param context
 * @param url     当前图片url
 * @param list    图片URL
 */
public static void show(Context context, String url, List<String> list) {
    try {
        int positon = list.indexOf(url);
        Intent intent = new Intent(context, ImagePagerActivity.class);
        // 图片url,为了演示这里使用常量,一般从数据库中或网络中获取
        intent.putStringArrayListExtra(ImagePagerActivity.EXTRA_IMAGE_URLS, (ArrayList<String>) list);
        intent.putExtra(ImagePagerActivity.EXTRA_IMAGE_INDEX, positon);
        context.startActivity(intent);
    } catch (Exception e) {
        Log.e("imagezoom", e.getMessage());
    }
}
 
Example 12
Project: wheretomeet-android   File: PlaceResponseHandler.java   View Source Code Vote up 6 votes
@Override
public void onSuccess(int statusCode, Header[] headers, byte[] responseBody) {

    if(statusCode==204) {
        Toast.makeText(activity, "There is no right place", Toast.LENGTH_SHORT).show();
    }
    else {
        response = new String(responseBody);
        System.out.println(response);

        Intent map=new Intent(activity.getApplicationContext(),MapsActivity.class);
        map.putExtra("place",response);

        double []locationx=new double[30];
        double []locationy=new double[30];
        ArrayList<String> name=new ArrayList<String>();

        for(int i=0;i<friends.size();i++) {
            locationx[i]=friends.get(i).locationx;
            locationy[i]=friends.get(i).locationy;
            name.add(friends.get(i).name);
        }

        map.putExtra("locationx",locationx);
        map.putExtra("locationy",locationy);
        map.putStringArrayListExtra("name",name);
        map.putExtra("mylat",activity.lat);
        map.putExtra("mylog",activity.log);

        activity.startActivity(map);
    }
}
 
Example 13
Project: MyFire   File: ImgSelActivity.java   View Source Code Vote up 6 votes
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();
}
 
Example 14
Project: boohee_v5.6   File: MultiImageSelectorActivity.java   View Source Code Vote up 6 votes
public void onSingleImageSelected(String path) {
    Intent data = new Intent();
    this.resultList.add(path);
    data.putStringArrayListExtra(EXTRA_RESULT, this.resultList);
    setResult(-1, data);
    finish();
}
 
Example 15
Project: decoy   File: PreviewImageFromLocalActivity.java   View Source Code Vote up 6 votes
public static Intent initPreviewImageIntent(
        ArrayList<String> thumbnailImageList,
        ArrayList<String> orignialImageList,
        boolean isOrignial
        ) {        
    Intent intent = new Intent();
    intent.putStringArrayListExtra(Extras.EXTRA_SCALED_IMAGE_LIST, thumbnailImageList);
    intent.putStringArrayListExtra(Extras.EXTRA_ORIG_IMAGE_LIST, orignialImageList);
    intent.putExtra(Extras.EXTRA_IS_ORIGINAL, isOrignial);
    return intent;
}
 
Example 16
Project: PeSanKita-android   File: GroupCreateActivity.java   View Source Code Vote up 6 votes
@Override
public void onClick(View v) {
  Intent intent = new Intent(GroupCreateActivity.this, PushContactSelectionActivity.class);
  if (groupToUpdate.isPresent()) intent.putExtra(ContactSelectionListFragment.DISPLAY_MODE,
                                                 ContactSelectionListFragment.DISPLAY_MODE_PUSH_ONLY);

  ArrayList<String> numbers = new ArrayList<String>();
  for (Recipient recipient : getAdapter().getRecipients()) {
    numbers.add(recipient.getNumber());
  }

  intent.putStringArrayListExtra(ContactSelectionListFragment.PRE_SELECT, numbers);

  startActivityForResult(intent, PICK_CONTACT);
}
 
Example 17
Project: SugarPhotoPicker   File: PhotoPickerActivity.java   View Source Code Vote up 6 votes
public void onSingleImageSelected(String path) {
    if (isComplete) return;
    isComplete = true;
    Intent data = new Intent();
    resultList.add(path);
    data.putStringArrayListExtra(EXTRA_RESULT, resultList);
    setResult(RESULT_OK, data);
    finish();
}
 
Example 18
Project: boohee_v5.6   File: MQPhotoPickerPreviewActivity.java   View Source Code Vote up 5 votes
public void onBackPressed() {
    Intent intent = new Intent();
    intent.putStringArrayListExtra(EXTRA_SELECTED_IMAGES, this.mSelectedImages);
    setResult(0, intent);
    finish();
}
 
Example 19
Project: PaoMovie   File: CameraMain2.java   View Source Code Vote up 5 votes
@Override
public void onClick(View v) {
	int id = v.getId();
	switch (id) {
	case R.id.video_choose_cancel:
		finish();
		return;
	case R.id.video_choose_next:
		if (chooseVideo.size() == 0) {
			Toast.makeText(this, "至少选一个", 1).show();
		} else {
			ArrayList<String> videoPaths = new ArrayList<String>();
			for (Map.Entry entry : chooseVideo.entrySet()) {
				videoPaths.add(entry.getValue().toString());
			}
			Intent i = new Intent(this, HoDragVideo.class);
			i.putStringArrayListExtra("videos", videoPaths);
			startActivity(i);
		}
		return;
	default:
		break;
	}
	// TODO Auto-generated method stub
	if (v.getTag() != null && (int) v.getTag() == 1000) {
		Intent intent = new Intent(MediaStore.ACTION_VIDEO_CAPTURE);

		Uri fileUri = getOutputMediaFileUri();
		intent.putExtra(MediaStore.EXTRA_OUTPUT, fileUri);
		intent.putExtra(MediaStore.EXTRA_VIDEO_QUALITY, 1);
		startActivityForResult(intent, 1);
	} else {
		int chkId = 300000 + (int) v.getTag();
		CheckBox chk = (CheckBox) CameraMain2.this.findViewById(chkId);

		chk.setChecked(!chk.isChecked());
		// String videoPath = getPath((int) v.getTag());
		// Intent i = new Intent(CameraMain2.this, VideoPlayer.class);
		// i.putExtra("videoPath", videoPath);
		// i.putExtra("videoButton", (int) v.getTag() + 1000);
		// CameraMain2.this.startActivityForResult(i, 2);
	}
}
 
Example 20
Project: boohee_v5.6   File: MQPhotoPickerActivity.java   View Source Code Vote up 5 votes
private void returnSelectedImages(ArrayList<String> selectedImages) {
    Intent intent = new Intent();
    intent.putStringArrayListExtra(EXTRA_SELECTED_IMAGES, selectedImages);
    setResult(-1, intent);
    finish();
}