使用4.4以上手机返回值不同问题.当版本号低于4.4时,选用自带的返回path为content://com.android.providers.media.documents/document/image%3A25554
而使用文件按管理器返回的确是正常的/storage/emulated/0/.UTSystemConfig/Global/Alvin2.xml
这个怎么判断???求解
请不要从网上复制打开图片的方法,试了很多,没用
拥有18年软件开发和IT教学经验。曾任多家上市公司技术总监、架构师、项目经理、高级软件工程师等职务。 网络人气名人讲师,...
當回傳的uri是content://開頭的時候就去對應ContentProvicer來查詢該uri對應的檔案
content://com.android.providers.media.documents/document/image%3A25554这个是系统的DocumentsUI返回的特有的URI,需要使用系统自带的DocumentsContract这个类来解析。而/storage/emulated/0/.UTSystemConfig/Global/Alvin2.xml是檔案的本地路徑可以直接使用。
content://com.android.providers.media.documents/document/image%3A25554
DocumentsUI
DocumentsContract
/storage/emulated/0/.UTSystemConfig/Global/Alvin2.xml
當回傳的uri是content://開頭的時候就去對應ContentProvicer來查詢該uri對應的檔案
content://com.android.providers.media.documents/document/image%3A25554
这个是系统的DocumentsUI
返回的特有的URI,需要使用系统自带的DocumentsContract
这个类来解析。而/storage/emulated/0/.UTSystemConfig/Global/Alvin2.xml
是檔案的本地路徑可以直接使用。