我下载了库加载图片的示例,如
Cursor imagecursor = managedQuery(MediaStore.Images.Media.EXTERNAL_CONTENT_URI,
columns, null, null, orderBy);
当我打印MediaStore.Images.Media.EXTERNAL_CONTENT_URI
时,我得到:
content://media/external/images/media .
但是如何从目录中更改为加载:
Environment.getExternalStorageDirectory() + "/test/";
我试过
Uri uri=Uri.parse(Environment.getExternalStorageDirectory() + "/test/");
和
Uri uri=Uri.parse("content:"Environment.getExternalStorageDirectory() + "/test/");
但它不起作用。有人能帮助我吗?
答案 0 :(得分:0)
试试这个,
File ff = new File("/sdcard/test");
Cursor imagecursor = managedQuery(Uri.fromFile(ff), columns, null, null, orderBy);