0

Is there other ways to get only video that you like, not all video in the folder is included.

w

videoCursorArtist = getContentResolver().query(sourceUri, projection,
                null, selectionArgs, orderByARTIST);

How to do it?

Piolo Opaw
  • 1,471
  • 2
  • 15
  • 21

1 Answers1

0

I do that like so :

String[] arrayOfString = { "_data" };
        mediaCursor = getContentResolver().query(MediaStore.Video.Media.EXTERNAL_CONTENT_URI, arrayOfString, null, null, null);
        if ((mediaCursor != null) && (mediaCursor.getCount() > 0))
        {
          dataIdx = mediaCursor.getColumnIndex("_data");
          playNextVideo();
        }
  • example i have a folder video, vid1, vid2, vid3, i dont want to include vid2 in the query, how to do it? because i want to filter the video before aplying the cursor to the Adapter in listview. – Piolo Opaw Mar 13 '14 at 08:19
  • To be honest, i'm not sure, never needed something like that. Googling on this shows me you're able to get the name of the video by doing mediaCursor.getString(0). Maybe you can do something like if mediacursor.getstring(2) != null skip video and go to the next one. See http://stackoverflow.com/questions/10329500/sqlite-how-to-get-string-items-using-cursor-android for more info – user3274355 Mar 13 '14 at 08:32
  • how about is it possible to drop a row in cursor? – Piolo Opaw Mar 13 '14 at 09:00
  • I am not sure what you mean by that, try creating a new question – user3274355 Mar 13 '14 at 09:07
  • How to drop a columnIndex in a cursor, is it posible? – Piolo Opaw Mar 13 '14 at 09:11