Within a MapActivity on an Eclair test phone, I have installed an
OnTouchListener to only listen for screen taps. If I just tap the
screen it receives events OK. I can keep doing this indefinitely, and
it works OK. I am not interested in anything fancy. I don't care
about move events or guessture detection, just taps. However, after I
perform a multi-touch activity to expand or contract the map view, the
OnTouchListener no longer receives any callbacks whatsoever. The
multi-touch continues to work, but I no longer receive *any* event
callbacks in the OnTouchListener. The essential parts of my code are
here
private class MyTouchListener implements View.OnTouchListener {
public boolean onTouch(View view, MotionEvent event) {
int action = event.getAction();
if (action == MotionEvent.ACTION_DOWN) {
mPosX = event.getX();
mPosY = event.getY();
processEvent(mPosX, mPosY);
return true;
}
return false;
}
}
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.mapview);
MapView myMapView = (MapView) findViewById(R.id.mapview);
myMapView.setBuiltInZoomControls(true);
TouchListener mTouchListener = new TouchListener();
myMapView.setOnTouchListener(mTouchListener);
// other stuff here
}
Within mapview.xml, I have the following
<com.google.android.maps.MapView
android:id="@+id/mapview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:clickable="true"
android:apiKey="SOME_KEY_HERE"
/>
Does anyone know how to fix this so that my OnTouchListener can
integrate cohesively with the default multi-touch activity code inside
of the MapActivity class? What do I need to do so that my
OnTouchListener receives callbacks after multi-touch activity?
--
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