Hi all,
WebView seems to stop firing onTouch events after the builtin zoom
controls have been used.
I've got a WebView displaying an image from the web. I want users to
be able to use the builtin zoom controls (+/- buttons, and pinch-zoom,
when it's available), but I also want to be able to display a dialog
containing some text when the user clicks the image in the WebView.
WebView doesn't produce onClick events, so I've attached an
onTouchListener to emulate clicks. I've got something like this:
webview = (WebView)findViewById(R.id.viewer);
webview.getSettings().setBuiltInZoomControls(true);
webview.setOnTouchListener(new OnTouchListener() {
public boolean onTouch(View v, MotionEvent event) {
// show dialog on click
}
});
When the activity starts, the user can click the WebView and show the
dialog, as expected. But if they drag or pinch-zoom the WebView, the
WebView stops firing onTouch events, and the dialog won't show any
more.
This seems to happen on 1.6 and 2.1 (at the very least), and both on
hardware and in the emulator. Why does it happen? I can't find it
documented anywhere. Are there any workarounds?
Regards,
Tom
--
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