You can not. If you override the method provided in the API class, you will have to extend that class. I would suggest implementing your own View and overriding the onScroll method.
public class YourCustomView extends View { @Override public void onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) { } }
However, I do not think this is the best way to deal with the situation. I would suggest using ViewHolder . Basically, this is a container that contains information about your View items. I would recommend using it, especially if you have a list or several items to process. You can read everything here in this question !
source share