我已将视频文件存储在此处: -
File mediaStorageDir = new File(Environment.getExternalStoragePublicDirectory(
Environment.DIRECTORY_PICTURES), "MyCameraVideo");
if (! mediaStorageDir.exists()){
if (! mediaStorageDir.mkdirs()){
Log.d("MyCameraVideo", "Failed to create directory MyCameraVideo.");
return null;
}
}
检索: -
videocursor = getContentResolver().query(MediaStore.Video.Media.EXTERNAL_CONTENT_URI,
proj, null, null, null);
但是,我从sdcard获取所有视频文件,这是我不想要的。我只想要存储在" MyCameraVideo"文件夹中。
提前致谢..
答案 0 :(得分:0)
试试这个:
String selection = MediaStore.Video.Media.DATA +" like?";
String[] selectionArgs = new String[]{"%MyCameraVideo%"};
videocursor = managedQuery(MediaStore.Video.Media.EXTERNAL_CONTENT_URI,
parameters, selection, selectionArgs, null);