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)