Skip to main content

i want to play two files one after another on a single click of Button [closed]



i want to play two files one after another on a single click of Button.Files are in assets folder .







if (play)

{ mp.stop();

mp.release();

mp = null;

}

btn1.setImageDrawable(getResources().getDrawable(R.drawable.key1));

mp = new MediaPlayer();

try {

descriptor = getAssets().openFd("c1.mp3");

descriptor1 = getAssets().openFd("d2.mp3");

mp.setDataSource(descriptor.getFileDescriptor(), descriptor.getStartOffset(), descriptor.getLength());

mp.prepare();

mp.start();

mp.setDataSource(descriptor1.getFileDescriptor(), descriptor1.getStartOffset(), descriptor1.getLength());

mp.prepare();

mp.start();

}

catch (IOException e)

{ // TODO Auto-generated catch block

e.printStackTrace();

}



play = true




Comments

Popular posts from this blog

Slow Android emulator

I have a 2.67 GHz Celeron processor, 1.21 GB of RAM on a x86 Windows XP Professional machine. My understanding is that the Android emulator should start fairly quickly on such a machine, but for me it does not. I have followed all instructions in setting up the IDE, SDKs, JDKs and such and have had some success in staring the emulator quickly but is very particulary. How can I, if possible, fix this problem?