Can someone help me understand why the compiler is complaining about this code. I get two errors:
The method onGenericMotionEvent(MotionEvent) is undefined for the type HorizontalScrollView The method onGenericMotionEvent(MotionEvent) of type MyHorizontalScrollView must override a superclass method Accroding to the API, onGenericMotionEvent is a public method of HorizontalScrollView - http://developer.android.com/reference/android/widget/HorizontalScrollView.html#onGenericMotionEvent(android.view.MotionEvent) import android.content.Context; import android.util.AttributeSet; import android.widget.HorizontalScrollView; import android.view.MotionEvent; public class MyHorizontalScrollView extends HorizontalScrollView { public MyHorizontalScrollView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); // TODO Auto-generated constructor stub } public MyHorizontalScrollView(Context context, AttributeSet attrs) { super(context, attrs); // TODO Auto-generated constructor stub } public MyHorizontalScrollView(Context context) { super(context); // TODO Auto-generated constructor stub } @Override public boolean onGenericMotionEvent (MotionEvent event) { // TODO put some code here to control horizontal scrolling return super.onGenericMotionEvent(event); } } Thanks! Mark On Fri, Oct 28, 2011 at 9:01 AM, Mark Phillips <m...@phillipsmarketing.biz>wrote: > I have a table with 10 columns and 11 rows. All the columns are the same > size, except the first and last. I only want to display three columns at a > time - the first, a middle column, and the last column. Vertical scrolling > is handle normally. > > My layout is: > > LinearLayout > ScrollView (for vertical scrolling) > HorizontalScrollView > TableLayout > > My plan is to extend HorizontalScrollView and override > onGenericMotionEvent, use the ActionMask to find any horizontal scrolling, > and scroll the table by using collapseColumn() to make one of the middle > columns visible based on the x direction of scrolling. Does this seem > feasible? Has anyone tried this before? Is there a better way? > > Thanks! > > Mark > -- 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