I'm trying to detect if the user has touched a specific area of the
screen in an onTouch event and if so, handle the even and run some
logic. If it was not in the specific part of the screen, it will pass
the even back down to the map so they can slide/zoom/ect as normal.

my code is

public class Map extends MapActivity implements OnTouchListener {
        public MapView _mvMap;
        @Override
        public void onCreate(Bundle savedInstanceState) {
                super.onCreate(savedInstanceState);
                setContentView(R.layout.mapview);
                _mvMap = (MapView) findViewById(R.id.mvMap);
                // Code Omitted
                _mvMap.setOnTouchListener(this);
        }

        public boolean onTouch(View v, MotionEvent event) {
                boolean InRect = CheckInRect(event);
                if (InRect) return true;
                _mvMap.onTouchEvent(event); //Seems to clear any existing 
listener
so reset it back to the handler
                _mvMap.setOnTouchListener(this);
                return true;
        }
// Omitted

Ok so, if InRect == True everything works fine and I will keep
receiving touches. But if I dont touch InRect, I'll get the first
ACTION_DOWN and the following ACTION_MOVE but any further actions,
including ACTION_UP are never received; Touch events just go straight
to the MapView from then on.

If there a correct way of handling/passing down touch events that I'm
not getting?

-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en

Reply via email to