Android Studios. Load Spinner with all the names of the songs you have in the raw directory

0

esoty making a kind of playlist. I'm working with the "raw" directory of android studios where videos are put ... music etc .. and what I pretend is that, in one of the windows (activitys) of this is responsible for registering a song so that it ends in the list, my intention is that in the spinner on the left the name of the songs that runs from the raw folder and load them, and I'm not getting it done  

I managed to make a splash, but for a single one in particular, now I would have to go through the raw folder to load all the raw that I have instead of specifying it myself

here the example

public void cargaSpinnerMusica () {         ArrayList Musicname = new ArrayList ();         nameMusic.add ("- Choose a Music -");         try {

        String lector = getResources().getResourceName(R.raw.atiquetesalelodellocahostnoelerrorese);
        String nombre_real = lector.split("/")[1];

        nombreMusicas.add(nombre_real);

      //  lector.close();
    } catch (Exception e) {

    }
    ArrayAdapter adapter = new ArrayAdapter(this, android.R.layout.simple_spinner_item, nombreMusicas);
    spinner_musicas.setAdapter(adapter);
}
    
asked by Selito95 28.03.2018 в 14:54
source

0 answers