Never mind, I found the solution in an older reply by Romain Guy: http://groups.google.com/group/android-developers/browse_thread/thread/d15edc816a0b436c/92ec68238acd1c62
You have to override either Activity.dispatchTouchEvent(MotionEvent) or ViewGroup.onInterceptTouchEvent(MotionEvent) See: http://developer.android.com/guide/topics/ui/ui-events.html#EventHandlers for more information. Am Montag, 7. November 2011 um 16:22 schrieb Philipp: > Hi, I have a problem: > > I have a ViewGroup (LinearLayout) that holds one or more Fragments, > each containing a WebView. > I have a custom OnTouchListener for my ViewGroup that will react to > special events like touches on the screen borders. If none of these > special events is detected, the touch event should be passed to the > WebView. > The problem is that the WebView is the first element to get the touch > event and there does not seem to be a way to delegate the touch event > to the underlying View. > How can I modify the touch hierarchy in a way that the ViewGroup > receives the TouchEvent first and only if it doesn’t consume the event > it is passed to the WebView? > > I made an example project to illustrate my problem at > https://github.com/pcomans/WebViewTouchTest > > I have chosen to add two fragments containing a WebView in order to > make clear that it is not enough to just override the > setOnTouchListener of the WebView instead. I am interested in the > absolute position of the touch. Sure I could probably calculate the > absolute position from the relative position but this is not an > elegant solution. > > I would really appreciate any help! > > Best, > > Philipp -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en