【发布时间】:2015-12-19 12:16:16
【问题描述】:
在我的项目中,我需要一种方法来获取从图库中选择的多个图像的路径。 我正在使用这个库MultipleSelectImages
它显然工作正常,但在 onActivityResult 我需要包含每个图像路径的数组,但是我得到的结果是这样的:
Paths: [com.darsh.multipleimageselect.models.Image@1e6d3057, com.darsh.multipleimageselect.models.Image@33824744]
...当我需要真实路径时(/storage/emulated/0/DCIM/Camera/20150426_110936.jpg)
阅读图书馆的文档没有找到解决方案。
这是 onActivityResult 方法:
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == Constants.REQUEST_CODE && resultCode == RESULT_OK && data != null) {
//The array list has the image paths of the selected images
ArrayList<Image> images = data.getParcelableArrayListExtra(Constants.INTENT_EXTRA_IMAGES);
Log.i("myLogs", "Paths:" + " " + images);
}
}
...从库中导入“图像”的位置
import com.darsh.multipleimageselect.models.Image;
我没有使用 EXTRA_ALLOW_MULTIPLE,因为需要该应用在 android api 16 版本中运行
提前致谢。
【问题讨论】: