Play music in my Android application

0

I want to make a playlist with song names, and when I click on any item in the playlist play the song. Does anyone know how to do this?

I was looking for websites out there and found this:

public void playAudio(View view){
    mp = MediaPlayer.create(this, R.raw.musica1);
    mp.setOnCompletionListener(new MediaPlayer.OnCompletionListener(){
        public void onCompletion(MediaPlayer mp) {
            mp.stop();
            mp.release();
            mp = null;
        }
    });
    mp.start();
}

It worked to play the song when you clicked the button.

I used this R.raw.musica1, this music1 and the name of my music, how can I put it in a string or straight into a list?

    
asked by anonymous 05.12.2014 / 14:02

0 answers