Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Ok, so this is what I have come up with so far. The buttons work just fine, however I am still unable to allow more than one to be pressed at a time.. I have set an OnTouchListener for each button (I have 8), and here is the OnTouchListener event:
- OnTouchListener padTouch = new OnTouchListener() {
- public boolean onTouch(View v, MotionEvent event)
- {
- if(event.getAction() == MotionEvent.ACTION_DOWN)
- {
- switch (v.getId())
- {
- case R.id.pad1:
- PlaySound(SOUND_PAD_1);
- break;
- case R.id.pad2:
- PlaySound(SOUND_PAD_2);
- break;
- case R.id.pad3:
- PlaySound(SOUND_PAD_3);
- break;
- case R.id.pad4:
- PlaySound(SOUND_PAD_4);
- break;
- case R.id.pad5:
- PlaySound(SOUND_PAD_5);
- break;
- case R.id.pad6:
- PlaySound(SOUND_PAD_6);
- break;
- case R.id.pad7:
- PlaySound(SOUND_PAD_7);
- break;
- case R.id.pad8:
- PlaySound(SOUND_PAD_8);
- break;
- }
- }
- return false;
- }
- is there anything that I should do to enable this?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement