原文Github地址:https://github.com/AlexZhuo/AlxImageLoader
调用
Intent intent = new Intent(this,SelectPhotoActivity.class);
Bundle bundle=new Bundle();
bundle.putInt("selectedPhotoNum",adapter.getItemCount());
intent.putExtras(bundle);
startActivityForResult(intent,10);
在onActivityResult()
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
Log.i("Alex","mainActivity的onActivityResult req="+requestCode+" result="+requestCode);
if(data == null || resultCode != SelectPhotoActivity.SELECT_PHOTO_OK)return;
boolean isFromCamera = data.getBooleanExtra("isFromCamera",false);
final ArrayList<SelectPhotoAdapter.SelectPhotoEntity> selectedPhotos = data.getParcelableArrayListExtra("selectPhotos");
Log.i("Alex","选择的图片是"+selectedPhotos);
}