Pobieranie piosenek z Android z karty SD

Pobieram moje piosenki z karty SD i umieszczam go w widoku listy.

Używam tej metody. ale to zajmuje trochę czasu i jeśli ścieżka jest inna, nie dostałem tych danych.

więc ,QUE Czy jest jakiś pomocny skrypt, który wyświetla utwory ze wszystkich moich kart SD? Jeśli są w katalogu / utworach.

<code>public ArrayList<HashMap<String, String>> getPlayList(){
        File home = new File(MEDIA_PATH);

        if (home.listFiles(new FileExtensionFilter()).length > 0) {
            for (File file : home.listFiles(new FileExtensionFilter())) {
                HashMap<String, String> song = new HashMap<String, String>();
                song.put("songTitle", file.getName().substring(0, (file.getName().length() - 4)));
                song.put("songPath", file.getPath());

                // Adding each song to SongList
                songsList.add(song);
            }
        }
        // return songs list array
        return songsList;
    }


    class FileExtensionFilter implements FilenameFilter {
        public boolean accept(File dir, String name) {
            return (name.endsWith(".mp3") || name.endsWith(".MP3"));
        }
    }
</code>

Proszę o komentarze.

questionAnswers(5)

yourAnswerToTheQuestion