Hi,

No, it's because the android team decided to implement MultiTouch in a
way that it only can be used on one "View". For example, ImageButtons
are views. Each ImageButton is a seperate "View" object. The Android
multitouch does not just map touches to multiple views like that
(which I think it should, but the android team does not). Instead you
end up having to create a View yourself, and drawing the three buttons
yourself, since multitouch comes to a View as additional touch
coordinates. In other words, you can only use multitouch "per view".
It can't spread across multiple views. You basically need to create
one big view object that takes up most of the screen and then draw the
buttons yourself, and then handle the multitouch messages passed to
that view.

Unless there is an easier way that I know of, but I dont think there
is. IMO how they "implemented" multitouch is too hackish, and should
have been transparent to developers by the system automatically
posting messages to each view that was being touched, instead, you
have to rewrite the apps completely to handle it.

-niko

On May 2, 11:28 am, Codeman <[email protected]> wrote:
> I'm using imagebuttons that play sounds using SoundPool. Here is
> example code a couple of the imagebuttons:
>
> ImageButton Button1 = (ImageButton)findViewById(R.id.sound1);
> Button1.setOnTouchListener(new OnTouchListener() {
>
>         public boolean onTouch(View v, MotionEvent event) {
>             if (event.getAction() == MotionEvent.ACTION_DOWN ) {
>                 mSoundManager.playSound(1);
>                 return false;
>             }
>
>             return false;
>         }
>     });
>
> ImageButton Button2 = (ImageButton)findViewById(R.id.sound2);
> Button2.setOnTouchListener(new OnTouchListener() {
>
>         public boolean onTouch(View v, MotionEvent event) {
>             if (event.getAction() == MotionEvent.ACTION_DOWN ) {
>                 mSoundManager.playSound(2);
>                 return false;
>             }
>
>             return false;
>         }
>     });
>
> For some reason, it doesn't allow you to click multiple buttons at the
> same time. Is it because I'm building for 1.6 SDK?
>
> Thanks!
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group 
> athttp://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to