[英]Why there is no problem with Uri.fromFile even in android:targetSdkVersion = “25”?
[英]Why Uri.fromFile() will not work on Android 7.0+, with a targetSdkVersion of 24 or higher. and what can be the alternate solution ? (Kotlin)
android.os.FileUriExposedException: file:///null 通过 ClipData.Item.getUri() 暴露在应用程序之外
这是向我显示的错误。 什么是合适的选择?
--->这可以是另一种选择<----
改变:
返回 Uri.fromFile(mediaFile);
成为:
返回 FileProvider.getUriForFile(getApplicationContext(), getPackageName()+".fileprovider", mediaFile);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.