Set dispatchTouchEvent for List View without creating custom List View class. (for disabling scroll)
问题 I'm basically trying to disable the scroll on List View. Which can be done by @Override public boolean dispatchTouchEvent(MotionEvent ev){ if(ev.getAction()==MotionEvent.ACTION_MOVE){ ev.setAction(MotionEvent.ACTION_CANCEL); } super.dispatchTouchEvent(ev); return true; } But I do not want to create a custom List View (widget) class for this. Is there any way I could do it like myListView.dispatchTouchEvent(ev) ??? Thanks in advance. 回答1: Give this a try: @Override public boolean