Step 1: Put the audio/video file in (res/raw) folder of your project. If the "raw" folder does not exist, create one.
Step 2: Put in the following code:-
Private MediaPlayer mp;
mp = MediaPlayer.create(this, R.raw.audiofilename);
mp.setLooping(true);
mp.start();
mp.setLooping(true);
mp.start();
Note:-
1. Change the audiofilename according to your own audio file name.
2. When you mp.setLooping(true), the audio file will play continuosly until you stop it.
Roger,
mytikus
1 comment:
this is wrong,first start(),and then loop.
Post a Comment