문제

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