Processing of sliding conflicts between ViewPager and HorizontalListView in Android, and processing of viewpager in android
In Android development, many controls have click or slide conflict events, such as the onitemclick event of ListView and the Button on item (if there is a Button. Today, HorizontalListView is applied to the page in ViewPager at work, and horizontal movement also conflicts. The solution is simple. You only need to override onInterceptTouchEvent (MotionEvent ev) in HorizontalListView and add getParent (). requestDisallowInterceptTouchEvent (true.
Public boolean onInterceptTouchEvent (MotionEvent ev ){
GetParent (). requestDisallowInterceptTouchEvent (true );
Return mGesture. onTouchEvent (ev );
};
Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.