• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps need help with my soundboard

TH90

Lurker
*Hello could you help me figure out how can i stop sound with mediaplayer after clicking another soundbutton?

*and how can i set alarm/ringtone/notification when long press

*and i need help with adding admob on my app, ive read all posts i could google but still i get errors, i cant undrustand what am i doing wrong, if anybody wishes to help me please pm me your skype and we can sort this out.
thank you very much.

code:
final MediaPlayer sound01 = MediaPlayer.create(this, R.raw.sound01);
Button s01 = (Button) findViewById(R.id.button01);
s01.setText(this.getString(R.string.quote01));
s01.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
try {
sound01.prepare();
} catch (IllegalStateException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
sound01.start();
}
 
Back
Top Bottom