I have a button (button1) and two sound (sound1, sound2), I want to implement a gesture to this button. if Button1 is clicked, then the sound is sound1 but if Button1 is touched by the gesture, the sound is sound2. to handle the sound, I use a SoundManager class. to handle touch I use multitouch class.
public class MyActivity extends MultiTouch {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.myactivity);
SoundManager.getInstance();
SoundManager.initSounds(this);
SoundManager.loadSounds();
Button Button1 = (Button)findViewById(R.id.button1);
Button1.setOnTouchListener(this);
Button1.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
// TODO Auto-generated method stub
SoundManager.playSound(1, 1);
}
});
}
public void onDestroy()
{
super.onDestroy();
SoundManager.cleanup();
}
}
Thank you so much