Вопрос

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?

Это было полезно?

Решение

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());
        }
    }
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top