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


Java Intent.putParcelableArrayListExtra方法代码示例

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


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

示例1: share

import android.content.Intent; //导入方法依赖的package包/类
public static void share(AppCompatActivity context, List<String> paths) {

        if (paths == null || paths.size() == 0) {
            return;
        }
        ArrayList<Uri> uris = new ArrayList<>();
        Intent intent = new Intent();
        intent.setAction(android.content.Intent.ACTION_SEND_MULTIPLE);
        intent.setType("*/*");
        for (String path : paths) {
            File file = new File(path);
            uris.add(Uri.fromFile(file));
        }
        intent.putParcelableArrayListExtra(Intent.EXTRA_STREAM, uris);
        context.startActivity(intent);
    }
 
开发者ID:LightSun,项目名称:android-util2,代码行数:17,代码来源:IntentHelper.java

示例2: start

import android.content.Intent; //导入方法依赖的package包/类
@Override
public void start() {
    AlbumActivity.mSizeFilter = mSizeFilter;
    AlbumActivity.mMimeFilter = mMimeTypeFilter;
    AlbumActivity.mDurationFilter = mDurationFilter;
    AlbumActivity.sResult = mResult;
    AlbumActivity.sCancel = mCancel;
    Intent intent = new Intent(mContext, AlbumActivity.class);
    intent.putExtra(Album.KEY_INPUT_REQUEST_CODE, mRequestCode);
    intent.putExtra(Album.KEY_INPUT_WIDGET, mWidget);
    intent.putParcelableArrayListExtra(Album.KEY_INPUT_CHECKED_LIST, mChecked);

    intent.putExtra(Album.KEY_INPUT_FUNCTION, Album.FUNCTION_CHOICE_VIDEO);
    intent.putExtra(Album.KEY_INPUT_CHOICE_MODE, Album.MODE_MULTIPLE);
    intent.putExtra(Album.KEY_INPUT_COLUMN_COUNT, mColumnCount);
    intent.putExtra(Album.KEY_INPUT_ALLOW_CAMERA, mHasCamera);
    intent.putExtra(Album.KEY_INPUT_LIMIT_COUNT, mLimitCount);
    intent.putExtra(Album.KEY_INPUT_FILTER_VISIBILITY, mFilterVisibility);
    mContext.startActivity(intent);
}
 
开发者ID:WeiXinqiao,项目名称:Recognize-it,代码行数:21,代码来源:VideoMultipleWrapper.java

示例3: onCalculateRoute2Home

import android.content.Intent; //导入方法依赖的package包/类
@Override
public void onCalculateRoute2Home(boolean showInRouteGuide) {
    if (showInRouteGuide) {
        showRouteGuide();
    } else {
        BaiduAddress ad = BaiduNaviDao.getInstance().getHomeOrCompanyAddress(getResources().getString(R.string.home));
        BaiduAddress nad = BaiduNaviDao.getInstance().get(((AppConfig) getApplication()).address);
        ArrayList<BaiduAddress> list = new ArrayList<>();
        if (ad != null)
            list.add(ad);
        list.add(nad);
        if (EventBus.getDefault().hasSubscriberForEvent(MapCmdEvent.class)) {
            EventBus.getDefault().post(new MapCmdEvent(MapCmdEvent.SHOW_TRAFFIC, list));
        } else {
            Intent intent = new Intent(AssistantService.this, TrafficShowActivity.class);
            intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
            intent.putParcelableArrayListExtra("addresses", list);
            startActivity(intent);
        }
    }
}
 
开发者ID:LingjuAI,项目名称:AssistantBySDK,代码行数:22,代码来源:AssistantService.java

示例4: shareMultipleFiles

import android.content.Intent; //导入方法依赖的package包/类
public void shareMultipleFiles(List<FileItem> filesToBeShared){

        ArrayList<Uri> uris = new ArrayList<>();
        for(FileItem file: filesToBeShared){
            uris.add(Uri.fromFile(file.getFile()));
        }
        final Intent intent = new Intent(Intent.ACTION_SEND_MULTIPLE);
        intent.setType("*/*");
        intent.putParcelableArrayListExtra(Intent.EXTRA_STREAM, uris);
        PackageManager manager = mContext.getPackageManager();
        List<ResolveInfo> infos = manager.queryIntentActivities(intent, 0);
        if (infos.size() > 0) {
            mContext.startActivity(Intent.createChooser(intent, mContext.getString(R.string.share)));
        } else {
            UIUtils.ShowToast("No app found to handle sharing",mContext);
        }
    }
 
开发者ID:adityak368,项目名称:Android-FileBrowser-FilePicker,代码行数:18,代码来源:FileIO.java

示例5: prepareEditContactIntentWithSipAddress

import android.content.Intent; //导入方法依赖的package包/类
public static Intent prepareEditContactIntentWithSipAddress(int id, String sipUri) {
	Intent intent = new Intent(Intent.ACTION_EDIT, Contacts.CONTENT_URI);
	Uri contactUri = ContentUris.withAppendedId(Contacts.CONTENT_URI, id);
	intent.setData(contactUri);
	
	ArrayList<ContentValues> data = new ArrayList<ContentValues>();
	ContentValues sipAddressRow = new ContentValues();
	sipAddressRow.put(Contacts.Data.MIMETYPE, SipAddress.CONTENT_ITEM_TYPE);
	sipAddressRow.put(SipAddress.SIP_ADDRESS, sipUri);
	data.add(sipAddressRow);
	intent.putParcelableArrayListExtra(Insert.DATA, data);
	
	return intent;
}
 
开发者ID:treasure-lau,项目名称:Linphone4Android,代码行数:15,代码来源:ApiElevenPlus.java

示例6: onActivityResult

import android.content.Intent; //导入方法依赖的package包/类
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    Intent intent = new Intent(FINISHED_ACTION);
    ArrayList<Uri> uris = new ArrayList<>();

    if (resultCode == Activity.RESULT_OK) {
        switch (requestCode) {
            case RC_GALLERY:
                uris = handleGallery(data);
                break;
            case RC_TAKE_VIDEO:
                uris.add(data.getData());
                break;
            case RC_TAKE_PHOTO:
                uris.add(outputUri);
                break;
        }
    } else if (requestCode == RC_TAKE_PHOTO) {
        getContentResolver().delete(outputUri, null, null);
    }

    intent.putParcelableArrayListExtra(EXTRA_URIS, uris);
    sendBroadcast(intent);

    finishAll();
}
 
开发者ID:marchinram,项目名称:RxGallery,代码行数:27,代码来源:RxGalleryActivity.java

示例7: ShareImagesToAssignAPP

import android.content.Intent; //导入方法依赖的package包/类
/**
 * 分享多图到指定软件,QQ,微信,新浪微博
 */
public static void ShareImagesToAssignAPP(Context context, List<File> fileList,String type) {
    boolean found = false;
    ArrayList<Uri> uriList = new ArrayList<>();
    Intent share = new Intent(Intent.ACTION_SEND_MULTIPLE);
    share.setType("image/*");
    for (int i = 0; i < fileList.size(); i++) {
        uriList.add(Uri.fromFile(fileList.get(i)));
    }
    List<ResolveInfo> resInfo = context.getPackageManager().queryIntentActivities(share, 0);
    if (!resInfo.isEmpty()){
        for (ResolveInfo info : resInfo) {
            if (info.activityInfo.packageName.toLowerCase().contains(type) ||
                    info.activityInfo.name.toLowerCase().contains(type) ) {
                share.setPackage(info.activityInfo.packageName);
                share.putParcelableArrayListExtra(Intent.EXTRA_STREAM, uriList);
                found = true;
                break;
            }
        }
        if (!found)
            return;
        context.startActivity(Intent.createChooser(share, "分享到"));
    }
}
 
开发者ID:tututututututu,项目名称:BaseCore,代码行数:28,代码来源:LocalShareUtils.java

示例8: drop

import android.content.Intent; //导入方法依赖的package包/类
public void drop(int from, int to) {
    if (from == to) return;

    // Sort networks by user selection
    List<WifiNetwork> networks = mAdapter.getNetworks();
    WifiNetwork o = networks.remove(from);
    networks.add(to, o);

    // Set the new priorities of the networks
    int cc = networks.size();
    ArrayList<WifiConfiguration> configList = new ArrayList<>();
    for (int i = 0; i < cc; i++) {
        WifiNetwork network = networks.get(i);
        network.config.priority = cc - i;
        configList.add(network.config);
    }

    mNetworksListView.invalidateViews();

    Intent intent = new Intent(ModHwKeys.ACTION_UPDATE_WIFI_CONFIG);
    intent.putParcelableArrayListExtra(ModHwKeys.EXTRA_WIFI_CONFIG_LIST, configList);
    intent.putExtra("receiver", mReceiver);
    WifiPriorityActivity.this.sendBroadcast(intent);
}
 
开发者ID:WrBug,项目名称:GravityBox,代码行数:25,代码来源:WifiPriorityActivity.java

示例9: launchForResult

import android.content.Intent; //导入方法依赖的package包/类
public static void launchForResult(Fragment fragment, ArrayList<BeautyPhotoInfo> datas, int index) {
    Intent intent = new Intent(fragment.getContext(), BigPhotoActivity.class);
    intent.putParcelableArrayListExtra(BIG_PHOTO_KEY, datas);
    intent.putExtra(PHOTO_INDEX_KEY, index);
    intent.putExtra(FROM_LOVE_ACTIVITY, true);
    fragment.startActivityForResult(intent, CommonConstant.REQUEST_CODE);
    fragment.getActivity().overridePendingTransition(R.anim.expand_vertical_entry, R.anim.hold);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:9,代码来源:BigPhotoActivity.java

示例10: onClick

import android.content.Intent; //导入方法依赖的package包/类
@Override
public void onClick(View v) {
    if (v.getId() == R.id.tv_media_preview) {
        Intent intent = new Intent(this, VanFiltratePreviewActivity.class);
        intent.putExtra(BasePreviewActivity.EXTRA_DEFAULT_BUNDLE, mSelectedCollection.getDataWithBundle());
        startActivityForResult(intent, REQUEST_CODE_PREVIEW);

    } else if (v.getId() == R.id.tv_media_apply) {
        Intent result = new Intent();
        ArrayList<Uri> selectedUris = (ArrayList<Uri>) mSelectedCollection.asListOfUri();
        result.putParcelableArrayListExtra(EXTRA_RESULT_SELECTION, selectedUris);
        setResult(RESULT_OK, result);
        finish();
    }
}
 
开发者ID:GitPhoenix,项目名称:VanGogh,代码行数:16,代码来源:VanMediaActivity.java

示例11: onCreate

import android.content.Intent; //导入方法依赖的package包/类
/** Called when the activity is first created. */
  @Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      
Intent i = getIntent();
Bundle e = i.getExtras();
if (i.getAction().equals(Intent.ACTION_SEND)) {
	if (e != null &&
		e.containsKey(Intent.EXTRA_STREAM))  {
		new Utils(this).sendReduced(
				(Uri)e.getParcelable(Intent.EXTRA_STREAM));
	}
	finish();
}
else if (i.getAction().equals(Intent.ACTION_SEND_MULTIPLE)) {
	if (e != null &&
			e.containsKey(Intent.EXTRA_STREAM)) {
		ArrayList<Uri> in = e.getParcelableArrayList(Intent.EXTRA_STREAM);
		ArrayList<Uri> out = new ArrayList<Uri>();
		Utils utils = new Utils(this);
		
		for (Uri uri: in) {
			Uri reduced = utils.reduce(uri);
			if (reduced != null)
				out.add(reduced);
		}
		
		if (out.size()>0) {
			Intent go = new Intent(android.content.Intent.ACTION_SEND_MULTIPLE);
			go.setType(Utils.MIME_TYPE);
			go.putParcelableArrayListExtra(android.content.Intent.EXTRA_STREAM, out);
			startActivity(go);
		}
	}
}
  }
 
开发者ID:sdrausty,项目名称:buildAPKsSamples,代码行数:38,代码来源:SendReduced.java

示例12: getShareIntent

import android.content.Intent; //导入方法依赖的package包/类
private Intent getShareIntent() {
    final ArrayList<Uri> uris = new ArrayList<>();
    uris.add(FileProvider.getUriForFile(getActivity(),getActivity().getApplicationContext().getPackageName() + getString(R.string.dot_provider),fileMap));

    final Intent shareIntent = new Intent();
    shareIntent.setAction(Intent.ACTION_SEND_MULTIPLE);
    shareIntent.putExtra(Intent.EXTRA_SUBJECT, getString(R.string.share_subject));
    shareIntent.putExtra(Intent.EXTRA_TEXT, "\n\n" + getString(R.string.share_text) + " " + getString(R.string.app_name) + " - " + getString(R.string.app_url));
    shareIntent.putParcelableArrayListExtra(Intent.EXTRA_STREAM, uris);
    shareIntent.setType("*/*");

    return shareIntent;
}
 
开发者ID:videgro,项目名称:Ships,代码行数:14,代码来源:ShowMapFragment.java

示例13: start

import android.content.Intent; //导入方法依赖的package包/类
/**
 * Start target select
 *
 * @param context
 */
public static void start(Context context) {
    Intent shareIntent = new Intent(Intent.ACTION_SEND);
    shareIntent.setDataAndType(Uri.parse("content://example"), "*/*");
    List<ResolveInfo> resolveInfo = context.getPackageManager().queryIntentActivities(shareIntent, 0);

    Intent intent = new Intent(context, ChooserActivity.class);
    intent.putParcelableArrayListExtra(EXTRA_RESOLVE_INFO, ResolveInfoHelper.filter(resolveInfo, true));
    context.startActivity(intent);
}
 
开发者ID:RikkaW,项目名称:Bridge,代码行数:15,代码来源:ChooserActivity.java

示例14: showDepartureStationList

import android.content.Intent; //导入方法依赖的package包/类
public void showDepartureStationList(View view) {
    if (stationList == null)
        return;
    Intent showList = new Intent(this, ShowStationListActivity.class);
    showList.putExtra("title", R.string.txtLocationHint);
    showList.putExtra("color", R.color.stationSelection);
    showList.putParcelableArrayListExtra("stops", stationList);
    startActivityForResult(showList, Utils.RESULT_GET_DEPARTURE_STATION);
}
 
开发者ID:Baleine82,项目名称:TrainPonctuality,代码行数:10,代码来源:EditTravelActivity.java

示例15: onOptionsItemSelected

import android.content.Intent; //导入方法依赖的package包/类
/**
 * Handle option menu's click event
 */
@Override
public boolean onOptionsItemSelected(MenuItem item) {
    int id = item.getItemId();

    if (id == android.R.id.home) {
        onBackPressed();
        return true;
    }

    if (id == menuDoneId) {
        if (selectedImages != null && selectedImages.size() > 0) {

            /** Scan selected images which not existed */
            for (int i = 0; i < selectedImages.size(); i++) {
                Image image = selectedImages.get(i);
                File file = new File(image.getPath());
                if (!file.exists()) {
                    selectedImages.remove(i);
                    i--;
                }
            }

            Intent data = new Intent();
            data.putParcelableArrayListExtra(ImagePickerActivity.INTENT_EXTRA_SELECTED_IMAGES, selectedImages);
            setResult(RESULT_OK, data);
            finish();
        }
        return true;
    }
    if (id == menuCameraId) {
        //captureImage();
        captureImageWithPermission();
        return true;
    }
    return super.onOptionsItemSelected(item);
}
 
开发者ID:sega4revenge,项目名称:Sega,代码行数:40,代码来源:ImagePickerActivity.java


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