iMobile mdatacollector在安卓7.0报错

0 投票

iMobile使用mdatacollector拍照在安卓7.0报FileUriExposedException错误,请问怎么解决。

使用产品:SuperMap iMobile 9D(2019)(V9.1.0) 操作系统:MIUI9 Android7.0
数据类型: 文件型
问题详细描述:如题
问题重现步骤:
code: 

mDataCollector = new MDataCollector(this);
mDataCollector.setLocalFilePath(sdcard + "SuperMap/MediaTemp/");
mDataCollector.captureImage();

exception:

android.os.FileUriExposedException: file:///storage/emulated/0/storage/emulated/0/SuperMap/MediaTemp/SMPartMedia.jpeg exposed beyond app through ClipData.Item.getUri()
    at android.os.StrictMode.onFileUriExposed(StrictMode.java:1799)
    at android.net.Uri.checkFileUriExposed(Uri.java:2346)
    at android.content.ClipData.prepareToLeaveProcess(ClipData.java:832)
    at android.content.Intent.prepareToLeaveProcess(Intent.java:8925)
    at android.content.Intent.prepareToLeaveProcess(Intent.java:8910)
    at android.app.Instrumentation.execStartActivity(Instrumentation.java:1519)
    at android.app.Activity.startActivityForResult(Activity.java:4399)
    at android.support.v4.app.BaseFragmentActivityApi16.startActivityForResult(BaseFragmentActivityApi16.java:54)
    at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:68)
    at android.app.Activity.startActivityForResult(Activity.java:4358)
    at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:751)
    at com.supermap.mdatacollector.MDataCollector$a.a(MDataCollector.java:1032)
    at com.supermap.mdatacollector.MDataCollector.captureImage(MDataCollector.java:250) 

11月 9, 2018 分类:  121次浏览 | 用户: xxxxst (1 分)

1个回答

0 投票

你好,这是Android本身的原因,请参考一下这篇博客:https://blog.csdn.net/longxuanzhigu/article/details/79460864

11月 12, 2018 用户: 董懿鑫 名扬四海 (3,453 分)
...