I need to allow the user to stop the music after a preset time. When user enters a new activity, I start the player with a looped sound. But I want the sound to stop automatically after a while. I use this code onCreate of the activity:
final MediaPlayer mp = MediaPlayer.create(getBaseContext(),R.raw.mysound);
mp.setLooping(true);
mp.start();
The music starts and never stops... that is not what I want. How do I stop the music after say... 70 seconds?
Thank you