Advertisement
Guest User

Untitled

a guest
Mar 27th, 2010
810
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.08 KB | None | 0 0
  1. 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:
  2.  
  3.     OnTouchListener padTouch = new OnTouchListener() {     
  4.         public boolean onTouch(View v, MotionEvent event)
  5.         {          
  6.             if(event.getAction() == MotionEvent.ACTION_DOWN)
  7.             {
  8.                 switch (v.getId())
  9.                 {
  10.                     case R.id.pad1:                
  11.                         PlaySound(SOUND_PAD_1);                
  12.                         break;
  13.                     case R.id.pad2:
  14.                         PlaySound(SOUND_PAD_2);
  15.                         break;
  16.                     case R.id.pad3:
  17.                         PlaySound(SOUND_PAD_3);
  18.                         break;
  19.                     case R.id.pad4:
  20.                         PlaySound(SOUND_PAD_4);
  21.                         break;
  22.                     case R.id.pad5:
  23.                         PlaySound(SOUND_PAD_5);
  24.                         break;
  25.                     case R.id.pad6:
  26.                         PlaySound(SOUND_PAD_6);
  27.                         break;
  28.                     case R.id.pad7:
  29.                         PlaySound(SOUND_PAD_7);
  30.                         break;
  31.                     case R.id.pad8:
  32.                         PlaySound(SOUND_PAD_8);
  33.                         break;                 
  34.                 }
  35.             }
  36.            
  37.             return false;
  38.        
  39.         }
  40.  
  41.  
  42.  
  43. is there anything that I should do to enable this?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement