Why isn鈥檛 multi-touch wor king for imagebuttons?

by niko20 » Wed, 05 May 2010 01:42:31 GMT

Sponsored Links

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.



Why isn鈥檛 multi-touch wor king for imagebuttons?

by Bob Kerns » Fri, 07 May 2010 23:05:14 GMT

 What about using a TouchDelegate to examine the touches first, and
forward them as separate events?

I haven't tried it, or even thought about it for more than two
minutes, but...

> >

Sponsored Links

Other Threads

1. Trying to access a text (string) array via integer AND question on image size vs ads

New question....

I'm trying to access an array of text strings by its integer index (at
laest, I think that's what I'm trying to do!).

The array is defined as (it's actually longer than this---this is the
shortened version):

        String[] descriptions = {"Santa Rosa Sound (NW FL)",
            "Sailboat on SR Sound", "SR Sound Sunset #1",
            "SR Sound Sunset #2", "SR Sound Sunset #3",
            "SR Sound Sunset #4", "NW FL Sunset",
            "SR Sound from Okaloosa Island", "Beaches on the
Island" );

and I'm trying to use it, just a few lines later, like this
shortened here):

   TextView statusText = (TextView) findViewById(R.id.status_text);

I also tried this:

   TextView statusText = (TextView) findViewById(R.id.status_text);

Eclipse insists on including an Object definition which merely
returns null.  I tried editing it to return descriptions(photoIndex),
and it Force Closed every time I tried to run it.  Obviously not the
right way to do this.

I *THINK* I'm following what an example shows to do, but I either get
null or a Force Close.  The example is at:


What I'm trying to do is access the descriptions array by the same
index that the photo being loaded onto the screen is using.  The idea
here is to replace the "1/39" with "Santa Rosa Sound (NW FL)".....

Can anyone either let me know what I'm doing wrong, or point me to the
appropriate FM that will show me how I *SHOULD* be doing it?  :-)


Another question regarding image dimensions.  This app will be
ad-supported, and in landscape mode, some of the photos take up the
entire screen on my Android.  Will that block ads from being seen?
Or is the container for this app reduced by the ads, thus reducing the
parent to be filled by the photo to begin with?


PS:  Last newbie question from me today...follow-ups to this, yes, but
another newbie question, not today......  If I get this working, I'm
for the day.  Then tomorrow, it's just cleaning up the screen...easy


2. Licensing on Formerly Paid Apps

If I have a paid app, and then change the price to free, can I still
use licensing to check if the user was one of those who paid for the


3. Connection between Android phone and python server

4. AlarmManager pitfalls

5. Bind to Service in Fragment

6. Music app that can see hidden folders?

7. OOT : Facebook ketangkep basah main "Belakang"