當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。