button.setOnClickListener(new View.OnClickListener() {
public void onClick(View v){
if(mp2.isPlaying()==true)
{mp2.stop();
mp.start();
}
else
mp.start();
}
});
button2.setOnClickListener(new View.OnClickListener() {
public void onClick(View v){
if(mp.isPlaying()==true)
{mp.stop();mp2.start();}
开发者_JS百科 else
mp2.start();
}
});
I press the first btn and the 1st song is playing.i press the second,the first stops and the second begins.But then, as i press the first btn, the second song stops but the first song is not playing...please help!!:)
You did not call prepare()
(or prepareAsync()
) and seekTo(0)
on your original MediaPlayer
to rewind it.
精彩评论