当前位置: 首页>>代码示例>>Java>>正文


Java Intent.putStringArrayListExtra方法代码示例

本文整理汇总了Java中android.content.Intent.putStringArrayListExtra方法的典型用法代码示例。如果您正苦于以下问题:Java Intent.putStringArrayListExtra方法的具体用法?Java Intent.putStringArrayListExtra怎么用?Java Intent.putStringArrayListExtra使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.content.Intent的用法示例。


在下文中一共展示了Intent.putStringArrayListExtra方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onItemClick

import android.content.Intent; //导入方法依赖的package包/类
@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);
}
 
开发者ID:Zyj163,项目名称:yyox,代码行数:20,代码来源:AttachmentItemClickListener.java

示例2: onActivityResult

import android.content.Intent; //导入方法依赖的package包/类
@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);
}
 
开发者ID:hushengjun,项目名称:FastAndroid,代码行数:18,代码来源:VideoPlugin.java

示例3: startMultiCall

import android.content.Intent; //导入方法依赖的package包/类
/**
 * 开始多人通话。
 * 返回当前会话用户列表提供者对象,用户拿到该对象后,异步从服务器取出当前会话用户列表后,
 * 调用提供者中的 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);
        }
    };
}
 
开发者ID:hushengjun,项目名称:FastAndroid,代码行数:32,代码来源:RongCallKit.java

示例4: onClick

import android.content.Intent; //导入方法依赖的package包/类
@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();
    }
}
 
开发者ID:zhihu,项目名称:Matisse,代码行数:17,代码来源:MatisseActivity.java

示例5: handleMessage

import android.content.Intent; //导入方法依赖的package包/类
@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);
}
 
开发者ID:Wolfterro,项目名称:HenDroid,代码行数:19,代码来源:GetInformationThread.java

示例6: onActivityResult

import android.content.Intent; //导入方法依赖的package包/类
@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);
}
 
开发者ID:hushengjun,项目名称:FastAndroid,代码行数:18,代码来源:AudioPlugin.java

示例7: startMultiCall

import android.content.Intent; //导入方法依赖的package包/类
/**
 * 发起多人通话
 *
 * @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);
}
 
开发者ID:LanguidSheep,项目名称:sealtalk-android-master,代码行数:26,代码来源:RongCallKit.java

示例8: onAddHabitClicked

import android.content.Intent; //导入方法依赖的package包/类
/**
 * 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);
}
 
开发者ID:CMPUT301F17T15,项目名称:CIA,代码行数:15,代码来源:HomeTabbedActivity.java

示例9: addGroupMembers

import android.content.Intent; //导入方法依赖的package包/类
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();
}
 
开发者ID:starryxp,项目名称:LQRWeChat-master,代码行数:12,代码来源:CreateGroupAtPresenter.java

示例10: show

import android.content.Intent; //导入方法依赖的package包/类
/**
 * 跳转到图片预览页面
 *
 * @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());
    }
}
 
开发者ID:snowwolf10285,项目名称:PicShow-zhaipin,代码行数:20,代码来源:ImageZoom.java

示例11: onSuccess

import android.content.Intent; //导入方法依赖的package包/类
@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);
    }
}
 
开发者ID:ChristopherJdL,项目名称:wheretomeet-android,代码行数:33,代码来源:PlaceResponseHandler.java

示例12: exit

import android.content.Intent; //导入方法依赖的package包/类
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();
}
 
开发者ID:wp521,项目名称:MyFire,代码行数:10,代码来源:ImgSelActivity.java

示例13: onSingleImageSelected

import android.content.Intent; //导入方法依赖的package包/类
public void onSingleImageSelected(String path) {
    Intent data = new Intent();
    this.resultList.add(path);
    data.putStringArrayListExtra(EXTRA_RESULT, this.resultList);
    setResult(-1, data);
    finish();
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:8,代码来源:MultiImageSelectorActivity.java

示例14: initPreviewImageIntent

import android.content.Intent; //导入方法依赖的package包/类
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;
}
 
开发者ID:newDeepLearing,项目名称:decoy,代码行数:12,代码来源:PreviewImageFromLocalActivity.java

示例15: onClick

import android.content.Intent; //导入方法依赖的package包/类
@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);
}
 
开发者ID:XecureIT,项目名称:PeSanKita-android,代码行数:16,代码来源:GroupCreateActivity.java


注:本文中的android.content.Intent.putStringArrayListExtra方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。