Question

I have many files in different formats under raw folders. I just want to list only video files. How can i compare them in android.

Any idea or snippet code?

Was it helpful?

Solution

try this

public void listRaw(){
        Field[] fields=R.raw.class.getFields();
        for(int count=0; count < fields.length; count++){
          if(fields[count].getName().toUpperCase().endsWith(".3GP"))
            Log.i("Raw Asset: ", fields[count].getName());
        }
    }
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top