Skip to content Skip to sidebar Skip to footer

Display Video Files In Listview From Sdcard Folder

I am trying to display video files in listview from folder 'abc' on sdcard, i have successfully displayed but problem is that it displays all video files stored on sdcard even out

Solution 1:

Don't use the content provider in this case. The content provider will give you info on all the videos that it can find on your device.

Write your own little utility to scan and pick up the files/folders that you require.

Solution 2:

Provide a filtering criteria to the managed query that filters for your folder name.

Look at the javadoc for the method. It has criteria for the selection of records. That should allow you to select your desired subset.

Solution 3:

Dont Use This following code:

video_column_index = videocursor.getColumnIndexOrThrow(MediaStore.Video.Media.DATA);

Edit This code with the following code:

videocursor = MainActivity.this.managedQuery(MediaStore.Video.Media.EXTERNAL_CONTENT_URI,null, MediaStore.Images.Media.DATA + " like ? ",new String[] {"%abc%"},null);

THIS WILL HELP YOU FOR SURE.......

Post a Comment for "Display Video Files In Listview From Sdcard Folder"