-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Description
OS: Android 6.0
在StrictMode开启后会有如下的错误,而且照片没有保存成功:
E/StrictMode: null
java.lang.Throwable: file:// Uri exposed through ClipData.Item.getUri()
at android.net.Uri.checkFileUriExposed(Uri.java:2346)
at android.content.ClipData.prepareToLeaveProcess(ClipData.java:825)
at android.content.Intent.prepareToLeaveProcess(Intent.java:8240)
at android.app.Instrumentation.execStartActivity(Instrumentation.java:1508)
at android.app.Activity.startActivityForResult(Activity.java:3930)
at android.app.Activity.startActivityForResult(Activity.java:3890)
at com.jph.takephoto.uitl.TUtils.startActivityForResult(TUtils.java:39)
at com.jph.takephoto.uitl.TUtils.captureBySafely(TUtils.java:69)
at com.jph.takephoto.app.TakePhotoImpl.onPickFromCaptureWithCrop(TakePhotoImpl.java:249)
file:// 因为安全的原因比较新版本的Android系统被废弃了, 解决方案可以参考里的使用 content:// 来替代 file:// https://stackoverflow.com/questions/32623304/when-take-photo-get-java-lang-throwable-file-uri-exposed-through-clipdata
Metadata
Metadata
Assignees
Labels
No labels