In my code, I use a predetermined XML layout to generate the Views in my Activity. I don\'t create them programmatically, therefore I can\'t find a way to override the onInt
Extend the class you are interested in:
package com.myapp;
public class MyLayout extends RelativeLayout {
// Don't forget to include all the super constructors...
public void onInterceptTouchEvent(...){}
}
Then, you can use that class in xml like this:
<com.myapp.MyLayout
android:id="@+id/my_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<!-- acts just like a RelativeLayout, except for your custom code -->
</com.myapp.MyLayout>