I am creating a video player app, and i done most of the parts but when i started implementing the folder part to show all videos present in a specific folder through MediaStore
it gives me result like below i explained it.
folderName
- /storage/external_SD
20 videos in it.But it has only 5 videos in it, and rest is in the subFolders of this /storage/external_SD
i.e, /storage/external_SD/DCIM/Camera
it has 15 videos that means all videos are sumed up and result shown in /storage/external_SD
only is 20.
I want 5 videos from /storage/external_SD
and rest from other like /storage/external_SD/DCIM/Camera
.
Thanks in advance suggest me something.
code for selection :
String folder = "/storage/external_SD";
String selection = MediaStore.Video.Media.DATA + " like?";
String[] selectionArgs = new String[]{"%" + folder + "%"};
Cursor c = context.getContentResolver().query(uri, projection, selection, selectionArgs, sortOrder);