본문 바로가기

IT개발일지/Android

[Android]Click ViewPager 터치/클릭

public class ClickViewPager extends ViewPager {

public ClickViewPager(Context context) {
super(context);
}

public ClickViewPager(Context context, AttributeSet attrs) {
super(context, attrs);
}


@Override
public boolean onInterceptTouchEvent(MotionEvent ev) {
try {
return super.onInterceptTouchEvent(ev);
} catch (Exception e) {
e.printStackTrace();
return false;
}
}
@Override
public boolean onTouchEvent(MotionEvent ev) {
try {
return super.onTouchEvent(ev);
} catch (IllegalArgumentException ex) {
ex.printStackTrace();
}
return false;
}

}


클릭 뷰페이저