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


Java Intent.getParcelableArrayListExtra方法代码示例

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


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

示例1: onActivityResult

import android.content.Intent; //导入方法依赖的package包/类
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    if (data == null) {
        return;
    }
    if (resultCode == Activity.RESULT_OK && requestCode == IMAGE_PREVIEW_REQUEST_CODE) {
        mIsPreview = false;
        boolean isBackClick = data.getBooleanExtra(BoxingViewActivity.EXTRA_TYPE_BACK, false);
        List<BaseMedia> selectedMedias = data.getParcelableArrayListExtra(Boxing.EXTRA_SELECTED_MEDIA);
        onViewActivityRequest(selectedMedias, mMediaAdapter.getAllMedias(), isBackClick);
        if (isBackClick) {
            mMediaAdapter.setSelectedMedias(selectedMedias);
            mMediaAdapter.notifyDataSetChanged();
        }
        updateMultiPickerLayoutState(selectedMedias);
    }

}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:20,代码来源:BoxingViewFragment.java

示例2: handleSendMultipleImages

import android.content.Intent; //导入方法依赖的package包/类
private void handleSendMultipleImages(Intent intent) {
    ArrayList<Uri> imageUris = intent.getParcelableArrayListExtra(Intent.EXTRA_STREAM);
    mEtContent.setText("分享照片");
    mEtContent.setSelection(mEtContent.length());
    if (imageUris != null && !imageUris.isEmpty()) {
        int size = imageUris.size();
        if (size > 9) {
            size = 9;
        }
        Uri uri;
        for (int i = 0; i < size; i++) {
            uri = imageUris.get(i);
            mPhotoList.add(new Photo(uri.getPath()));
        }
        mPhotoAdapter.setData(mPhotoList);
    }
}
 
开发者ID:liying2008,项目名称:Simpler,代码行数:18,代码来源:WBPostActivity.java

示例3: onActivityResult

import android.content.Intent; //导入方法依赖的package包/类
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);

    if (requestCode == REQUEST_CODE_FILE && resultCode == Activity.RESULT_OK) {
        String file = data.getStringExtra(FileManagerFragment.returnFileParameter);

        ArrayList<LocalPhoto> photos = data.getParcelableArrayListExtra(Extra.PHOTOS);

        if(nonEmpty(file)){
            getPresenter().fireFileForUploadSelected(file);
        } else if(nonEmpty(photos)){
            getPresenter().fireLocalPhotosForUploadSelected(photos);
        }
    }
}
 
开发者ID:PhoenixDevTeam,项目名称:Phoenix-for-VK,代码行数:17,代码来源:DocsFragment.java

示例4: onActivityResult

import android.content.Intent; //导入方法依赖的package包/类
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    Bundle extras = nonNull(data) ? data.getExtras() : null;
    Logger.d(tag(), "onActivityResult, extras: " + extras);

    if(requestCode == REQUEST_ADD_VKPHOTO && resultCode == Activity.RESULT_OK){
        ArrayList<Photo> vkphotos = data.getParcelableArrayListExtra(Extra.ATTACHMENTS);
        ArrayList<LocalPhoto> localPhotos = data.getParcelableArrayListExtra(Extra.PHOTOS);
        getPresenter().firePhotosSelected(vkphotos, localPhotos);
    }

    if(requestCode == REQUEST_SELECT_ATTACHMENTS && resultCode == Activity.RESULT_OK){
        ArrayList<AbsModel> attachments = data.getParcelableArrayListExtra(Extra.ATTACHMENTS);
        getPresenter().fireAttachmentsSelected(attachments);
    }

    if (requestCode == REQUEST_PHOTO_FROM_CAMERA && resultCode == Activity.RESULT_OK) {
        getPresenter().firePhotoMaked();
    }
}
 
开发者ID:PhoenixDevTeam,项目名称:Phoenix-for-VK,代码行数:22,代码来源:MessageAttachmentsFragment.java

示例5: onActivityResult

import android.content.Intent; //导入方法依赖的package包/类
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    if (resultCode == RESULT_OK) {
        if (requestCode == ADDED_ADMINS_CODE) {
            addedUsers = data.getParcelableArrayListExtra(Constants.ADDED_ADMINS_EXTRA);
            tvAdmins.setText(getString(R.string.add_admins_with_number, addedUsers.size()));
        } else if (requestCode == ImagePicker.PICK_IMAGE_REQUEST_CODE) {
            eventBitmapIntent = data;
            updateEventImage(ImagePicker.getImageFromResult(this, requestCode, resultCode, data));
        }
    }
}
 
开发者ID:GrenderG,项目名称:Protestr,代码行数:13,代码来源:CreateEventActivity.java

示例6: setCodecPriorities

import android.content.Intent; //导入方法依赖的package包/类
/**
 * Sets codec priorities
 * Sends {@link BroadcastEventSender#codecPrioritiesSetStatus(boolean)}.
 * @param intent The caller intent.
 */
private void setCodecPriorities(Intent intent) {
    ArrayList<CodecPriority> codecPriorities = intent.getParcelableArrayListExtra(PARAM_CODEC_PRIORITIES);

    if (codecPriorities == null) {
        return;
    }

    startStack();

    if (!mStarted) {
        mBroadcastEventSender.codecPrioritiesSetStatus(false);
        return;
    }

    try {
        StringBuilder log = new StringBuilder();
        log.append("Codec priorities successfully set. The priority order is now:\n");

        for (CodecPriority codecPriority : codecPriorities) {
            mEndpoint.codecSetPriority(codecPriority.getCodecId(), (short) codecPriority.getPriority());
            log.append(codecPriority.toString()).append("\n");
        }

        SharedPreferencesUtil.persistConfiguredCodecPriorities(this, codecPriorities);
        Log.d(TAG, log.toString());
        mBroadcastEventSender.codecPrioritiesSetStatus(true);

    } catch (Exception exc) {
        Log.e(TAG, "Error while setting codec priorities", exc);
        mBroadcastEventSender.codecPrioritiesSetStatus(false);
    }
}
 
开发者ID:d0pam1n,项目名称:DoorPhone,代码行数:38,代码来源:SipService.java

示例7: getAllowableAccountSet

import android.content.Intent; //导入方法依赖的package包/类
/**
 * Returns a set of whitelisted accounts given by the intent or null if none specified by the
 * intent.
 */
private Set<Account> getAllowableAccountSet(final Intent intent) {
    Set<Account> setOfAllowableAccounts = null;
    final ArrayList<Parcelable> validAccounts =
            intent.getParcelableArrayListExtra(EXTRA_ALLOWABLE_ACCOUNTS_ARRAYLIST);
    if (validAccounts != null) {
        setOfAllowableAccounts = new HashSet<>(validAccounts.size());
        for (Parcelable parcelable : validAccounts) {
            setOfAllowableAccounts.add((Account) parcelable);
        }
    }
    return setOfAllowableAccounts;
}
 
开发者ID:coding-dream,项目名称:TPlayer,代码行数:17,代码来源:ChooseTypeAndAccountActivity.java

示例8: getResult

import android.content.Intent; //导入方法依赖的package包/类
/**
 * get the media result.
 */
@Nullable
public static ArrayList<BaseMedia> getResult(Intent data) {
    if (data != null) {
        return data.getParcelableArrayListExtra(EXTRA_RESULT);
    }
    return null;
}
 
开发者ID:devzwy,项目名称:NeiHanDuanZiTV,代码行数:11,代码来源:Boxing.java

示例9: getExternalData

import android.content.Intent; //导入方法依赖的package包/类
public void getExternalData() {
        Intent intent = getIntent();
        pushUrl = intent.getStringExtra("pushurl");
//        pushUrl=" rtmp://video-center.alivecdn.com/live/123?vhost=ali.zipindao.tv";//阿里流
//        pushUrl="rtmp://appa-push.zipindao.tv/live/110";//网宿流
        eventUrl = intent.getStringExtra("eventurl");
        openID = intent.getStringExtra("openid");
        memberlevelId = Integer.parseInt(intent.getStringExtra("memberlevelid"));
        productList = intent.getParcelableArrayListExtra("products_list");
        mShareInfo = intent.getParcelableExtra("shareinfo");
    }
 
开发者ID:JunGeges,项目名称:AliZhiBoHao,代码行数:12,代码来源:PushParamsActivity.java

示例10: onActivityResult

import android.content.Intent; //导入方法依赖的package包/类
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    if(requestCode == REQUEST_SELECT_PROFILES && resultCode == Activity.RESULT_OK){
        ArrayList<User> users = data.getParcelableArrayListExtra(Extra.USERS);
        AssertUtils.requireNonNull(users);
        postPrenseterReceive(presenter -> presenter.fireAddToBanUsersSelected(users));
    }
}
 
开发者ID:PhoenixDevTeam,项目名称:Phoenix-for-VK,代码行数:10,代码来源:CommunityBlacklistFragment.java

示例11: onActivityResult

import android.content.Intent; //导入方法依赖的package包/类
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);

    if (requestCode == REQUEST_CODE_SELECT_USERS_FOR_CHAT && resultCode == Activity.RESULT_OK) {
        ArrayList<User> users = data.getParcelableArrayListExtra(Extra.USERS);
        AssertUtils.requireNonNull(users);

        getPresenter().fireUsersForChatSelected(users);
    }
}
 
开发者ID:PhoenixDevTeam,项目名称:Phoenix-for-VK,代码行数:12,代码来源:DialogsFragment.java

示例12: onCreate

import android.content.Intent; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_more_friends_detail_info);

    Intent intent = getIntent();
    mFilterString = intent.getStringExtra("filterString");
    mFilterFriendList = intent.getParcelableArrayListExtra("filterFriendList");
    initView();
    initData();
}
 
开发者ID:zqHero,项目名称:rongyunDemo,代码行数:12,代码来源:SealSearchMoreFriendsActivity.java

示例13: checkLocalStreams

import android.content.Intent; //导入方法依赖的package包/类
public static ArrayList<Uri> checkLocalStreams(Activity activity) {
    Intent intent = activity.getIntent();
    if (intent == null) {
        return null;
    }

    Bundle extras = intent.getExtras();
    String action = intent.getAction();
    if (extras == null || action == null) {
        return null;
    }

    if (Intent.ACTION_SEND_MULTIPLE.equals(action)) {
        if (extras.containsKey(Intent.EXTRA_STREAM)) {
            return intent.getParcelableArrayListExtra(Intent.EXTRA_STREAM);
        }
    }

    if (Intent.ACTION_SEND.equals(action)) {
        if (extras.containsKey(Intent.EXTRA_STREAM)) {
            Uri uri = intent.getParcelableExtra(Intent.EXTRA_STREAM);
            if (uri != null) {
                ArrayList<Uri> streams = new ArrayList<>(1);
                streams.add(uri);
                return streams;
            }
        }
    }

    return null;
}
 
开发者ID:PhoenixDevTeam,项目名称:Phoenix-for-VK,代码行数:32,代码来源:ActivityUtils.java

示例14: onActivityResult

import android.content.Intent; //导入方法依赖的package包/类
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
    if (data == null) {
        return;
    }
    if (requestCode == FLAG_OPEN_GROUP_MEMBER && resultCode == Activity.RESULT_OK) {
        mRPUserBean = data.getParcelableExtra(RPConstant.EXTRA_GROUP_USER);
        mList = data.getParcelableArrayListExtra(RPConstant.EXTRA_GROUP_MEMBERS);
        if (!TextUtils.equals(mRPUserBean.userNickname, mContext.getString(R.string.tv_all_person))) {
            mIsExclusive = true;
            mEtMoneyCount.setEnabled(false);
            mEtMoneyCount.setText("1");
            mEtMoneyAmount.setText("");
            mTvAmount.setText("");
            enableButton(false);
            mIvRandomIcon.setVisibility(View.VISIBLE);
            mIvRandomIcon.setBackgroundResource(R.drawable.rp_exclusive_icon);
            mTvMoneyType.setVisibility(View.GONE);
            mTvAmount.setText(mContext.getString(R.string.group_money_total));
            if (mRedPacketInfo.groupMemberCount <= 0) {
                mTvGroupCount.setVisibility(View.VISIBLE);
                mTvGroupCount.setText(R.string.group_choose_few_person2);
            } else {
                mTvGroupCount.setText(String.format(getResources().getString(R.string.group_choose_few_person), mRedPacketInfo.groupMemberCount + ""));
            }
            mTvMoneyTypeInfo.setText(mContext.getString(R.string.msg_choose_few_person_red_packet));
        } else {//恢复之前的红包类型
            mIsExclusive = false;
            mEtMoneyCount.setEnabled(true);
            mTvMoneyType.setVisibility(View.VISIBLE);
            if (mRedPacketInfo.groupMemberCount <= 0) {
                mTvGroupCount.setVisibility(View.GONE);
            } else {
                mTvGroupCount.setText(String.format(getResources().getString(R.string.group_member_count), mRedPacketInfo.groupMemberCount + ""));

            }
            switchDefaultRedPacketType();
        }
        mTvReceiveName.setText(mRPUserBean.userNickname);

    }
}
 
开发者ID:YunzhanghuOpen,项目名称:redpacketui-open,代码行数:43,代码来源:SendGroupPacketFragment.java

示例15: onCreate

import android.content.Intent; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_image_picker);

    Intent intent = getIntent();
    if (intent == null) {
        finish();
    }

    mainLayout = (RelativeLayout) findViewById(R.id.main);
    progressBar = (ProgressWheel) findViewById(R.id.progress_bar);
    emptyTextView = (TextView) findViewById(R.id.tv_empty_images);
    recyclerView = (RecyclerView) findViewById(R.id.recyclerView);

    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);
    actionBar = getSupportActionBar();

    if (actionBar != null) {
        actionBar.setDisplayHomeAsUpEnabled(true);
        actionBar.setHomeAsUpIndicator(R.drawable.ic_arrow_back);
        actionBar.setDisplayShowTitleEnabled(true);
    }

    /** Get extras */
    limit = intent.getIntExtra(ImagePickerActivity.INTENT_EXTRA_LIMIT, Constants.MAX_LIMIT);
    mode = intent.getIntExtra(ImagePickerActivity.INTENT_EXTRA_MODE, ImagePickerActivity.MODE_MULTIPLE);
    folderMode = intent.getBooleanExtra(ImagePickerActivity.INTENT_EXTRA_FOLDER_MODE, false);

    if (intent.hasExtra(INTENT_EXTRA_FOLDER_TITLE)) {
        folderTitle = intent.getStringExtra(ImagePickerActivity.INTENT_EXTRA_FOLDER_TITLE);
    } else {
        folderTitle = getString(R.string.title_folder);
    }

    if (intent.hasExtra(INTENT_EXTRA_IMAGE_TITLE)) {
        imageTitle = intent.getStringExtra(ImagePickerActivity.INTENT_EXTRA_IMAGE_TITLE);
    } else {
        imageTitle = getString(R.string.title_select_image);
    }

    imageDirectory = intent.getStringExtra(ImagePickerActivity.INTENT_EXTRA_IMAGE_DIRECTORY);
    if (imageDirectory == null || TextUtils.isEmpty(imageDirectory)) {
        imageDirectory = getString(R.string.image_directory);
    }

    showCamera = intent.getBooleanExtra(ImagePickerActivity.INTENT_EXTRA_SHOW_CAMERA, true);
    if (mode == ImagePickerActivity.MODE_MULTIPLE && intent.hasExtra(ImagePickerActivity.INTENT_EXTRA_SELECTED_IMAGES)) {
        selectedImages = intent.getParcelableArrayListExtra(ImagePickerActivity.INTENT_EXTRA_SELECTED_IMAGES);
    }
    if (selectedImages == null)
        selectedImages = new ArrayList<>();
    images = new ArrayList<>();


    /** Set activity title */
    if (actionBar != null) {
        actionBar.setTitle(folderMode ? folderTitle : imageTitle);
    }

    /** Init folder and image adapter */
    imageAdapter = new ImagePickerAdapter(this, images, selectedImages, this);
    folderAdapter = new FolderPickerAdapter(this, new OnFolderClickListener() {
        @Override
        public void onFolderClick(Folder bucket) {
            foldersState = recyclerView.getLayoutManager().onSaveInstanceState();
            setImageAdapter(bucket.getImages());
        }
    });

    orientationBasedUI(getResources().getConfiguration().orientation);

}
 
开发者ID:sega4revenge,项目名称:Sega,代码行数:75,代码来源:ImagePickerActivity.java


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