java - 打开文件选择器返回文件路径
高洛峰
高洛峰 2017-04-18 09:19:33
0
2
519

使用4.4以上手机返回值不同问题.当版本号低于4.4时,
选用自带的返回path为content://com.android.providers.media.documents/document/image%3A25554

而使用文件按管理器返回的确是正常的/storage/emulated/0/.UTSystemConfig/Global/Alvin2.xml

这个怎么判断???求解

请不要从网上复制打开图片的方法,试了很多,没用

高洛峰
高洛峰

拥有18年软件开发和IT教学经验。曾任多家上市公司技术总监、架构师、项目经理、高级软件工程师等职务。 网络人气名人讲师,...

reply all(2)
伊谢尔伦

When the returned uri starts with content://, go to the corresponding ContentProvicer to query the file corresponding to the uri

左手右手慢动作

content://com.android.providers.media.documents/document/image%3A25554这个是系统的DocumentsUI返回的特有的URI,需要使用系统自带的DocumentsContract这个类来解析。而/storage/emulated/0/.UTSystemConfig/Global/Alvin2.xml is the local path of the file and can be used directly.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template