怎么获得指定文件夹的URI?

怎么获得指定文件夹的URI?

问题描述:

String a="file://"+Environment.getExternalStorageDirectory().getPath()
+"/DCIM/image/";
Uri uri =Uri.parse(a) ;
我是这样写的 但是不行 该怎么写呢?

额,有点想不明白的是,你既然已经知道文件夹的路径了,直接拼接就行了呀

比如:String folderPath = "F:/test";

则:String uri = "file:/" + folderPath + "/";

File f = new File("D:\james-2.3.2");
System.out.println(f.toURI());

File file = new File(Environment.getExternalStorageDirectory().toString() + "/dcim/Camera/");
直接取文件就可以了吧 为啥非要URI呢