-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
封装了一个函数 能完美获取真实文件路径兼容各种机型 #2882
Comments
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Current use version?
当前使用的版本是多少?3.11.2
Will this problem occur in demo?
Demo能否复现这问题?
Describe the problem or provide an error log?
描述问题或提供错误log?
3.11.2的版本
fun getPath2(context: Context, localMedia: LocalMedia): String? {
val path = localMedia.path ?: localMedia.realPath
return if (!path.isNullOrEmpty() && path.startsWith("content://")) {
val uri = Uri.parse(path)
PictureFileUtils.getPath(context, uri)
} else {
path
}
}
The text was updated successfully, but these errors were encountered: