请试试这个.
String[] STAR = { "*" };
Cursor cursor = managedQuery(MediaStore.Images.Media.EXTERNAL_CONTENT_URI
, STAR, null, null, null);
if (cursor != null)
{
if (cursor.moveToFirst())
{
do
{
String path = cursor.getString(cursor
.getColumnIndex(MediaStore.Images.Media.DATA));
Log.i("Path",path);
}while (cursor.moveToNext());
}
cursor.close();
}
Run Code Online (Sandbox Code Playgroud)
不要忘记在阅读SD卡的清单中给予许可.
归档时间: |
|
查看次数: |
2897 次 |
最近记录: |