I\'m currently developing a simple game and now it\'s time to add music and sound effect. I tried using MediaPlayer, just like described here: Android media pla
You should create an asychronous code to let media player play what he has to play in the background. Something like this:
final MediaPlayer mp = MediaPlayer.create(MainActivity.this, R.raw.nomarxia);
Handler mHandler = new Handler();
mHandler.postDelayed(new Runnable() {
public void run() {
mp.start();
}
}, mp.getDuration());