如何从给定的uri获取文件路径?

时间:2018-04-06 11:15:55

标签: android

uri如下:

content://com.google.android.apps.photos.contentprovider/-1/1/file%3A%2F%2F%2Fstorage%2Femulated%2F0%2FDCIM%2Fimg1.jpg/ORIGINAL/NONE/1347105467

获取路径返回以下数据,如下所示:

/-1/1/file:///storage/emulated/0/DCIM/img1.jpg/ORIGINAL/NONE/1347105467

在使用以下代码读取输入流时,我也变为null。

InputStream inputStream = getContentResolver().openInputStream(uri);

0 个答案:

没有答案
相关问题